Skip to content

Commit

Permalink
Fix bug where a new account could not be activated. (see #665)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnga committed Jul 7, 2017
1 parent a9a0019 commit fa1a854
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions gobotany/plantshare/emailconfirmation_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def get_users_for(self, email):
return [address.user for address in EmailAddress.objects.filter(
verified=True, email=email)]

class Meta:
app_label = 'emailconfirmation'


class EmailAddress(models.Model):

Expand Down Expand Up @@ -78,6 +81,7 @@ def __unicode__(self):
return u"%s (%s)" % (self.email, self.user)

class Meta:
app_label = 'emailconfirmation'
verbose_name = _("email address")
verbose_name_plural = _("email addresses")
unique_together = (
Expand Down Expand Up @@ -106,8 +110,7 @@ def send_confirmation(self, email_address):
current_site = Site.objects.get_current()
# check for the url with the dotted view path
try:
path = reverse("emailconfirmation.views.confirm_email",
args=[confirmation_key])
path = reverse('ps-confirm-email', args=[confirmation_key])
except NoReverseMatch:
# or get path with named urlconf instead
path = reverse(
Expand Down Expand Up @@ -147,6 +150,9 @@ def delete_expired_confirmations(self):
if confirmation.key_expired():
confirmation.delete()

class Meta:
app_label = 'emailconfirmation'


class EmailConfirmation(models.Model):

Expand All @@ -166,5 +172,6 @@ def __unicode__(self):
return u"confirmation for %s" % self.email_address

class Meta:
app_label = 'emailconfirmation'
verbose_name = _("email confirmation")
verbose_name_plural = _("email confirmations")
3 changes: 2 additions & 1 deletion gobotany/plantshare/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django import forms
from django.core.urlresolvers import reverse_lazy
from emailconfirmation_models import EmailAddress

from gobotany.plantshare.emailconfirmation_models import EmailAddress

from gobotany.plantshare.models import (Checklist, ChecklistEntry,
Location, ScreenedImage, SIGHTING_DEFAULT_VISIBILITY,
Expand Down

0 comments on commit fa1a854

Please sign in to comment.