From c35a0f429f64e1122594879bd5a158d765b84806 Mon Sep 17 00:00:00 2001 From: Nicolas Dietrich Date: Tue, 4 Mar 2014 23:33:16 +0100 Subject: [PATCH] Don't show validation intermediate pages if already validated --- src/adhocracy/controllers/user.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/adhocracy/controllers/user.py b/src/adhocracy/controllers/user.py index 50b5c066f..d2593078b 100644 --- a/src/adhocracy/controllers/user.py +++ b/src/adhocracy/controllers/user.py @@ -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')