Permalink
Browse files

Regressing bug introduced by the m2m Publisher commit. Non publisher …

…subclasses are also correctly saved now.
  • Loading branch information...
1 parent ef5a2c7 commit 84dc6046f2cf4aaed0c56cb31f9c3a0dfac52959 Jonathan Stoppani committed Mar 19, 2010
Showing with 9 additions and 5 deletions.
  1. +9 −5 publisher/models.py
View
@@ -182,13 +182,17 @@ def publish(self, excluded_models=None, first_instance=True):
obj = obj.publish(excluded_models=excluded_models, first_instance=False)
remote_pk = obj.pk
+
updated_obj_ids.append(remote_pk)
public_m2m_manager.add(obj)
- # save obj if it was dirty
- if obj.publisher_state == Publisher.PUBLISHER_STATE_DIRTY:
- self.publisher_state = Publisher.PUBLISHER_STATE_DEFAULT
- self._publisher_keep_state = True
- obj.save_base(cls=obj.__class__)
+
+ if issubclass(obj.__class__, Publisher):
@piquadrat
piquadrat May 12, 2010 Contributor

This seems a little odd. The same condition is checked on line 177, one indentation level higher. Is this an indentation error or simply superfluous?

+ # save obj if it was dirty
+ if obj.publisher_state == Publisher.PUBLISHER_STATE_DIRTY:
+ self.publisher_state = Publisher.PUBLISHER_STATE_DEFAULT
+ self._publisher_keep_state = True
+ obj.save_base(cls=obj.__class__)
+
# remove all not updated instances
# we have to do this, because m2m doesn't have dirty flag, and

0 comments on commit 84dc604

Please sign in to comment.