Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…subclasses are also correctly saved now.
  • Loading branch information...
commit 84dc6046f2cf4aaed0c56cb31f9c3a0dfac52959 1 parent ef5a2c7
Jonathan Stoppani authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 publisher/models.py
View
14 publisher/models.py
@@ -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 Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ # 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
Please sign in to comment.
Something went wrong with that request. Please try again.