Skip to content

Commit

Permalink
Implement fixes for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
bennylope committed Feb 17, 2017
1 parent 0a73762 commit 133a123
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions organizations/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ def save(self, *args, **kwargs):
"""
try:
user = get_user_model().objects.get(email__iexact=self.cleaned_data['email'])
# Send a notification email to this user to inform them that they
# have been added to a new organization.
invitation_backend().send_notification(
user,
**{'domain': get_current_site(self.request),
'organization': self.organization,
'sender': self.request.user})
except get_user_model().MultipleObjectsReturned:
raise forms.ValidationError(_("This email address has been used multiple times."))
except get_user_model().DoesNotExist:
Expand All @@ -112,6 +105,13 @@ def save(self, *args, **kwargs):
**{'domain': get_current_site(self.request),
'organization': self.organization,
'sender': self.request.user})
# Send a notification email to this user to inform them that they
# have been added to a new organization.
invitation_backend().send_notification(user, **{
'domain': get_current_site(self.request),
'organization': self.organization,
'sender': self.request.user,
})
return OrganizationUser.objects.create(user=user,
organization=self.organization,
is_admin=self.cleaned_data['is_admin'])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
You've been added to the organization {{ organization|safe }} on {{ domain.name }} by {{ sender.first_name|safe }} {{ sender.last_name|safe }}.
You've been added to the organization {{ organization|safe }} on {{ domain.name }} by {{ sender.full_name|safe }}.`

Follow the link below to view this organization.

Expand Down

0 comments on commit 133a123

Please sign in to comment.