-
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITC-128: remove unused views (#9246)
* clean dashboard views * clean retail + tdi views
- Loading branch information
Showing
5 changed files
with
4 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,71 +48,6 @@ def ratelimited(request, ratelimited=False): | |
return HttpResponseForbidden("You're ratelimited - Please try again soon", 403) | ||
|
||
|
||
@ratelimit(key='ip', rate='5/m', method=ratelimit.UNSAFE, block=True) | ||
def whitepaper_new(request, ratelimited=False): | ||
|
||
context = { | ||
'active': 'whitepaper', | ||
'title': _('Whitepaper'), | ||
'minihero': _('Whitepaper'), | ||
'suppress_logo': True, | ||
} | ||
if not request.POST.get('submit', False): | ||
return TemplateResponse(request, 'whitepaper_new.html', context) | ||
|
||
if ratelimited: | ||
context['msg'] = _("You're ratelimited. Please contact [email protected]") | ||
return TemplateResponse(request, 'whitepaper_accesscode.html', context) | ||
|
||
context['role'] = request.POST.getlist('role') | ||
context['email'] = request.POST.get('email') | ||
context['comments'] = request.POST.get('comments') | ||
context['success'] = True | ||
ip = get_ip(request) | ||
body = gettext(""" | ||
Email: {} \n | ||
Role: {}\n | ||
Comments: {}\n | ||
IP: {}\n | ||
https://gitcoin.co/_administration/tdi/whitepaperaccessrequest/ | ||
""").format(context['email'], context['role'], context['comments'], ip) | ||
send_mail( | ||
settings.CONTACT_EMAIL, | ||
settings.CONTACT_EMAIL, | ||
_("New Whitepaper Request"), | ||
str(body), | ||
categories=['admin', 'whitepaper_request'], | ||
) | ||
|
||
WhitepaperAccessRequest.objects.create( | ||
email=context['email'], | ||
role=context['role'], | ||
comments=context['comments'], | ||
ip=ip, | ||
) | ||
|
||
for code in AccessCodes.objects.all(): | ||
print(code) | ||
|
||
invite_to_slack(context['email']) | ||
|
||
valid_email = True | ||
try: | ||
validate_email(request.POST.get('email', False)) | ||
except ValidationError: | ||
valid_email = False | ||
|
||
if not request.POST.get('email', False) or not valid_email: | ||
context['msg'] = _("Invalid Email. Please contact [email protected]") | ||
context['success'] = False | ||
return TemplateResponse(request, 'whitepaper_new.html', context) | ||
|
||
context['msg'] = _("Your request has been sent. <a href=/slack>Meantime, why don't you check out the slack channel?</a>") | ||
return TemplateResponse(request, 'whitepaper_new.html', context) | ||
|
||
|
||
@ratelimit(key='ip', rate='5/m', method=ratelimit.UNSAFE, block=True) | ||
def whitepaper_access(request, ratelimited=False): | ||
|
||
|