<p dir="auto">This is a first draft for extending the new account deletion logic to remove the email address when the user has no edits.</p>
<p dir="auto">As suggested to me by <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/simonpoole/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/simonpoole">@simonpoole</a> it doesn't attempt to offer the user a choice and instead just always removes the email when the user has no edits.</p>
<p dir="auto">There is one tricky issue which is that changing <code>remove_personal_data</code> revealed that the use of <code>soft_destroy</code> by the user factory is problematic as it assumes that the user ID is set and uses it to set the display name (and now email) but when a user is created via a factory the user will not have been saved and won't have an ID yet.</p>
<p dir="auto">Currently I've changed the factory to use <code>hide</code> instead which only sets the status but that's possibly not ideal.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/3488'>https://github.com/openstreetmap/openstreetmap-website/pull/3488</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488/commits/07d7bb2f526cd643b3bbbb771db223f91c543ab8" class="commit-link">07d7bb2</a>  Make account deletion remove the email address when possible</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488/files">5 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488/files#diff-9802ca3c9c4cf89904fd44bc114e35ebdf2c5dd3d5b645491e2b253e1afef29b">app/models/user.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488/files#diff-8f87f7dfdba7dbded094bab5b6fa14deac0258fe482f50b79db021bbd4f28786">app/views/account/deletions/show.html.erb</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488/files#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7">config/locales/en.yml</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488/files#diff-3cb894babbd387f02bde8eb4daf7ddb6f0a5207d0562af589dc59a5653092c04">test/factories/user.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488/files#diff-6cb285739dd59adc60b303476dbd56b6ec750f160c32e9575ec5939d5f560a07">test/system/account_deletion_test.rb</a>
    (18)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3488.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/3488.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3488.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/3488.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3488">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJBXFY6ON6ERRRQKS3U6EEY3ANCNFSM5P3LLULA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPLTV37XBLZMZ7YLXLU6EEY3A5CNFSM5P3LLULKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4RIR3C2A.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/3488</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3488",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3488",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>