Write translations and fix pep8
This commit is contained in:
@@ -68,7 +68,7 @@ def application_accept(request, *args, **kwargs):
|
||||
if id is not None:
|
||||
application = Request.objects.get(id=id)
|
||||
else:
|
||||
return render(request,
|
||||
return render(request,
|
||||
'error.html',
|
||||
{'error': _("Application missing 'id' field.")})
|
||||
|
||||
@@ -79,9 +79,9 @@ def application_accept(request, *args, **kwargs):
|
||||
|
||||
if Member.objects.filter(email=application.email).exists():
|
||||
return render(request,
|
||||
'error.html',
|
||||
{'error': _('Email {} is already in use by a member. Application cannot be accepted.').format(application.email)})
|
||||
|
||||
'error.html',
|
||||
{'error': _('Email {} is already in use by a member. Application cannot be accepted.').format(application.email)})
|
||||
|
||||
member = application.to_member()
|
||||
member.save()
|
||||
application.delete()
|
||||
@@ -91,14 +91,14 @@ def application_accept(request, *args, **kwargs):
|
||||
"register with the following info: {}"
|
||||
.format(form))
|
||||
notification = "{} {}.".format(_("Successfully accepted application"),
|
||||
str(application))
|
||||
str(application))
|
||||
return HttpResponseRedirect(
|
||||
'/members/list?notification={}'.format(html.escape(notification)))
|
||||
except Exception as ex:
|
||||
logging.exception('Exception while accepting application')
|
||||
return render(request,
|
||||
'error.html',
|
||||
{'error': str(ex)})
|
||||
'error.html',
|
||||
{'error': str(ex)})
|
||||
else:
|
||||
logging.info(form)
|
||||
return render(request,
|
||||
@@ -125,7 +125,7 @@ def application_delete(request, *args, **kwargs):
|
||||
application.delete()
|
||||
logging.info(
|
||||
"Delete application in member register with the following id: {}"
|
||||
.format(id))
|
||||
.format(id))
|
||||
return HttpResponseRedirect(
|
||||
'/members/applications?notification={}'
|
||||
.format(html.escape(notification)))
|
||||
|
||||
Reference in New Issue
Block a user