Commit cc925fef authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Resend activation view improvements

- Redirect to index
- Check for authenticated user
parent c0a80b14
......@@ -128,7 +128,7 @@ SWITCH_ACCOUNT_LINK_SENT = 'This email is already associated wi
NOTIFICATION_SENT = 'Your request for an account was successfully received and is now pending approval. \
You will be notified by email in the next few days. \
Thanks for your interest in ~okeanos! The GRNET team.'
ACTIVATION_SENT = 'Activation sent.'
ACTIVATION_SENT = 'An email containing your activation link was sent to your email address.'
REGISTRATION_COMPLETED = 'Registration completed you can now login to your account.'
......
......@@ -713,6 +713,10 @@ def change_email(request, activation_key=None,
def send_activation(request, user_id, template_name='im/login.html', extra_context=None):
if request.user.is_authenticated():
messages.error(request, 'You are already signed in.')
return HttpResponseRedirect(reverse('edit_profile'))
if settings.MODERATION_ENABLED:
raise PermissionDenied
......@@ -726,6 +730,8 @@ def send_activation(request, user_id, template_name='im/login.html', extra_conte
send_activation_func(u)
msg = _(astakos_messages.ACTIVATION_SENT)
messages.success(request, msg)
return HttpResponseRedirect('/im/')
except SendMailError, e:
messages.error(request, e)
return render_response(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment