-
-
Notifications
You must be signed in to change notification settings - Fork 771
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 reconsenet from EU residents #1249
Conversation
@@ -0,0 +1,56 @@ | |||
''' | |||
Copyright (C) 2017 Gitcoin Core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
from marketing.mails import gdpr_reconsent | ||
from marketing.models import EmailSubscriber | ||
|
||
warnings.filterwarnings("ignore", category=DeprecationWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W291 trailing whitespace
app/retail/emails.py
Outdated
@@ -167,6 +168,17 @@ def render_new_bounty(to_email, bounties, old_bounties): | |||
|
|||
return response_html, response_txt | |||
|
|||
def render_gdpr_reconsent(to_email): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
app/retail/emails.py
Outdated
@staff_member_required | ||
def roundup(request): | ||
response_html, _, _ = render_new_bounty_roundup(settings.CONTACT_EMAIL) | ||
return HttpResponse(response_html) | ||
|
||
@staff_member_required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
Codecov Report
@@ Coverage Diff @@
## master #1249 +/- ##
==========================================
- Coverage 31.4% 31.28% -0.12%
==========================================
Files 119 120 +1
Lines 8238 8279 +41
Branches 1072 1075 +3
==========================================
+ Hits 2587 2590 +3
- Misses 5541 5579 +38
Partials 110 110
Continue to review full report at Codecov.
|
|
||
queryset = EmailSubscriber.objects.all() | ||
|
||
print("got {} emails".format(len(queryset))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can replace this with print('got', queryset.count(), 'emails')
or print(f'got {queryset.count()} emails')
to avoid the overhead of len()
and utilize print()
argument handling.
We hope that our content is useful to you. If you'd like to continue hearing from us, please update your subscription settings. | ||
</p> | ||
<p> | ||
<a class="button" href="https://gitcoin.co/settings/email/{{subscriber.priv}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use reverse with request path here, so we don't have to update urls throughout the codebase if a path changes.
print("got {} emails".format(len(queryset))) | ||
|
||
counter = 0 | ||
for es in queryset: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to use for counter, es in enumerate(queryset)
here
app/app/urls.py
Outdated
@@ -202,6 +202,7 @@ | |||
url(r'^_administration/email/bounty_feedback$', retail.emails.bounty_feedback, name='bounty_feedback'), | |||
url(r'^_administration/email/start_work_expire_warning$', retail.emails.start_work_expire_warning, name='start_work_expire_warning'), | |||
url(r'^_administration/email/start_work_expired$', retail.emails.start_work_expired, name='start_work_expired'), | |||
url(r'^_administration/email/gdpr_reconsent$', retail.emails.gdpr_reconsent, name='gdpr_reconsent'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll eventually need to update every url()
to the new methods: re_path()
and path()
- It'll be easier if we use those for new urls being added. Can we update this to re_path()
?
@@ -0,0 +1,56 @@ | |||
''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'''
can have unexpected consequences in py files. I've been trying to move to """
without the additional indent to pass pep-257 checks so we can ultimately auto-enforce this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
GDPR reconsenet from EU residents
Checklist
Affected core subsystem(s)
email
Testing
tested the mgmt command and in browser
Refers/Fixes
#1233