Revision 95b7c3f6

b/snf-astakos-app/astakos/im/messages.py
152 152
UNIQUE_EMAIL_IS_ACTIVE_CONSTRAIN_ERR = (
153 153
    "More than one account with the same email & 'is_active' field. Error."
154 154
)
155
INVALID_ACTIVATION_KEY = "Invalid activation key."
155
INVALID_ACTIVATION_KEY = "Invalid or already used activation key."
156 156
NEW_EMAIL_ADDR_RESERVED = (
157 157
    "The new email address you requested is already used by another account. "
158 158
    "Please provide a different one."
b/snf-astakos-app/astakos/im/tests/auth.py
603 603

  
604 604
        r = self.client.get(user.get_activation_url(), follow=True)
605 605
        # previous code got invalidated
606
        self.assertEqual(r.status_code, 404)
606
        self.assertRedirects(r, reverse('login'))
607
        self.assertContains(r, astakos_messages.INVALID_ACTIVATION_KEY)
608
        self.assertEqual(r.status_code, 200)
607 609

  
608 610
        user = AstakosUser.objects.get(pk=user.pk)
609 611
        self.assertEqual(len(get_mailbox(self.helpdesk_email)), 0)
b/snf-astakos-app/astakos/im/views/im.py
628 628
        user = AstakosUser.objects.select_for_update().\
629 629
            get(verification_code=token)
630 630
    except AstakosUser.DoesNotExist:
631
        raise Http404
631
        messages.error(request, astakos_messages.INVALID_ACTIVATION_KEY)
632
        return HttpResponseRedirect(reverse('index'))
632 633

  
633 634
    if user.email_verified:
634 635
        message = _(astakos_messages.ACCOUNT_ALREADY_VERIFIED)

Also available in: Unified diff