fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1c6ff1
)
don't notify when editing existing organizations
author
Jan Szejko
<janek37@gmail.com>
Fri, 20 Jan 2017 15:13:29 +0000
(16:13 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Fri, 20 Jan 2017 15:13:29 +0000
(16:13 +0100)
apps/organizations/forms.py
patch
|
blob
|
history
diff --git
a/apps/organizations/forms.py
b/apps/organizations/forms.py
index
5580766
..
16a8207
100644
(file)
--- a/
apps/organizations/forms.py
+++ b/
apps/organizations/forms.py
@@
-18,11
+18,13
@@
class OrganizationForm(forms.ModelForm):
exclude = ['_html']
def save(self, commit=True):
exclude = ['_html']
def save(self, commit=True):
+ new = self.instance.id is None
organization = super(OrganizationForm, self).save(commit=commit)
organization = super(OrganizationForm, self).save(commit=commit)
- site = Site.objects.get_current()
- send_notify_email(
- 'New organization in MIL/PEER',
- '''New organization in MIL/PEER: %s. View their profile: https://%s%s.
+ if new:
+ site = Site.objects.get_current()
+ send_notify_email(
+ 'New organization in MIL/PEER',
+ '''New organization in MIL/PEER: %s. View their profile: https://%s%s.
--
MIL/PEER team.''' % (organization.name, site.domain, organization.get_absolute_url()))
--
MIL/PEER team.''' % (organization.name, site.domain, organization.get_absolute_url()))