Smallfix: Fixed minor syntax error

remotes/origin/enhancement/email-actions
David Barragán Merino 2013-07-16 12:09:02 +02:00
parent 63316366ff
commit 066ed5124d
1 changed files with 8 additions and 13 deletions

View File

@ -56,7 +56,6 @@ class WatcherMixin(object):
class WatchedMixin(object): class WatchedMixin(object):
class Meta: class Meta:
abstract = True abstract = True
@ -70,8 +69,7 @@ class WatchedMixin(object):
def complete_change(self): def complete_change(self):
changed_attributes = self._get_changed_attributes() changed_attributes = self._get_changed_attributes()
del self._changer self.cancel_change()
del self._saved_attributes
watched_changed.send(sender=self, changed_attributes=changed_attributes) watched_changed.send(sender=self, changed_attributes=changed_attributes)
def get_watchers_to_notify(self): def get_watchers_to_notify(self):
@ -79,23 +77,20 @@ class WatchedMixin(object):
watchers_by_role = self._get_watchers_by_role() watchers_by_role = self._get_watchers_by_role()
owner = watchers_by_role.get('owner') owner = watchers_by_role.get('owner')
if owner \ if (owner and owner.allow_notify_owned()
and owner.allow_notify_owned() \ and owner.allow_notify_by_me(self._changer)):
and owner.allow_notify_by_me(self._changer):
watchers_to_notify.add(owner) watchers_to_notify.add(owner)
assigned_to = watchers_by_role.get('assigned_to') assigned_to = watchers_by_role.get('assigned_to')
if (assigned_to if (assigned_to and assigned_to.allow_notify_assigned_to()
and assigned_to.allow_notify_assigned_to()
and assigned_to.allow_notify_by_me(self._changer)): and assigned_to.allow_notify_by_me(self._changer)):
watchers_to_notify.add(assigned_to) watchers_to_notify.add(assigned_to)
suscribed_watchers = watchers_by_role.get('suscribed_watchers') suscribed_watchers = watchers_by_role.get('suscribed_watchers')
if suscribed_watchers: if suscribed_watchers:
for suscribed_watcher in suscribed_watchers: for suscribed_watcher in suscribed_watchers:
if suscribed_watcher \ if (suscribed_watcher and suscribed_watcher.allow_notify_suscribed()
and suscribed_watcher.allow_notify_suscribed() \ and suscribed_watcher.allow_notify_by_me(self._changer)):
and suscribed_watcher.allow_notify_by_me(self._changer):
watchers_to_notify.add(suscribed_watcher) watchers_to_notify.add(suscribed_watcher)
#(project, project_owner) = watchers_by_role.get('project_owner') #(project, project_owner) = watchers_by_role.get('project_owner')