Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDPR: Fixes https://github.com/gitcoinco/web/issues/1243 #1246

Merged
merged 7 commits into from
May 24, 2018

Conversation

owocki
Copy link
Contributor

@owocki owocki commented May 23, 2018

Description

Delete account ability in settings

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

settings

Testing

tested it

Refers/Fixes

#1243

@ghost ghost assigned owocki May 23, 2018
@ghost ghost added the in progress label May 23, 2018
logout_redirect = redirect(reverse('logout') + "?next=/")
return logout_redirect
else:
msg = "Error: did not understand your request"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F841 local variable 'msg' is assigned to but never used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to set msg to response['output'] and wrap this in gettext_lazy ?

msg = "Error: did not understand your request"


context = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E303 too many blank lines (2)

@@ -16,6 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.

'''
from django.contrib import messages

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.contrib.messages' imported but unused

@codecov
Copy link

codecov bot commented May 23, 2018

Codecov Report

Merging #1246 into master will decrease coverage by 0.06%.
The diff coverage is 15.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1246      +/-   ##
==========================================
- Coverage   31.59%   31.53%   -0.07%     
==========================================
  Files         118      118              
  Lines        8168     8192      +24     
  Branches     1065     1069       +4     
==========================================
+ Hits         2581     2583       +2     
- Misses       5477     5499      +22     
  Partials      110      110
Impacted Files Coverage Δ
app/app/urls.py 94.28% <ø> (ø) ⬆️
app/dashboard/models.py 63.98% <100%> (ø) ⬆️
app/marketing/views.py 15.07% <8.33%> (-0.72%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99c280d...3fbdb12. Read the comment docs.

@@ -14,7 +14,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
<script>
<script id="messages">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this change do?

Copy link
Contributor

@mbeacom mbeacom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments - I'll tackle these, unless there are objections to my comments.

@@ -908,7 +913,7 @@ class Profile(SuperModel):

"""

user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, blank=True)
user = models.OneToOneField(User, on_delete=models.SET(get_sentinel_user), null=True, blank=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just set this to: on_delete=models.SET_NULL - deleted user can only have one associated profile.

@@ -66,8 +67,11 @@ def get_settings_navs(request):
'body': 'Slack',
'href': reverse('slack_settings'),
}, {
'body': f"{subdomain}{settings.ENS_TLD}",
'body': f"ENS",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well eliminate the f here.

'href': reverse('ens_settings'),
}, {
'body': f"Account",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

logout_redirect = redirect(reverse('logout') + "?next=/")
return logout_redirect
else:
msg = "Error: did not understand your request"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to set msg to response['output'] and wrap this in gettext_lazy ?

<script>
$("document").ready(function(){
$("#delete").submit(function(e){
var _continue = confirm('Are you sure you want to delete all of your data from Gitcoin?');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we wrap this in trans?

profile.hide_profile = True
profile.save()
request.user.delete()
messages.success(request, _(f'Your account has been deleted'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can eliminate the f string here and above.

@ghost ghost assigned mbeacom May 24, 2018
logout_redirect = redirect(reverse('logout') + "?next=/")
return logout_redirect
else:
msg = "Error: did not understand your request"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F841 local variable 'msg' is assigned to but never used

@@ -52,6 +53,10 @@
logger = logging.getLogger(__name__)


def get_sentinel_user():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this function if we are using SET_NULL. @mbeacom

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SaptakS Addressed in: 8250d24

@@ -23,6 +23,7 @@
from urllib.parse import urlsplit

from django.conf import settings
from django.contrib.auth import get_user_model

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'django.contrib.auth.get_user_model' imported but unused

SaptakS
SaptakS previously approved these changes May 24, 2018
Copy link
Contributor

@SaptakS SaptakS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@SaptakS SaptakS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbeacom mbeacom merged commit 3deda9b into master May 24, 2018
@mbeacom mbeacom deleted the GDPR-deleteaccount branch May 24, 2018 15:01
@ghost ghost removed the in progress label May 24, 2018
mbeacom added a commit that referenced this pull request May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants