Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
Don't show validation intermediate pages if already validated
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Dietrich committed Mar 4, 2014
1 parent c440fe7 commit c35a0f4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/adhocracy/controllers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,24 @@ def activate(self, id):
def ask_activate(self, id):
c.page_user = get_entity_or_abort(model.User, id,
instance_filter=False)
if c.page_user.is_email_activated():
if c.came_from:
redirect(c.came_from)
else:
redirect(h.entity_url(c.page_user))

c.hide_activate_attention_getter = True
return render('/user/ask_activate.html')

def pending_activate(self, id):
c.page_user = get_entity_or_abort(model.User, id,
instance_filter=False)
if c.page_user.is_email_activated():
if c.came_from:
redirect(c.came_from)
else:
redirect(h.entity_url(c.page_user))

c.hide_activate_attention_getter = True
return render('/user/pending_activate.html')

Expand Down

0 comments on commit c35a0f4

Please sign in to comment.