Fix issue regarding duplicate state setting, and adding helpers #41

Merged
merged 2 commits into from Dec 14, 2015

Conversation

Projects
None yet
2 participants
Owner

johnsca commented Dec 14, 2015

No description provided.

@@ -470,7 +494,8 @@ def set_state(self, state):
'relation': self.relation_name,
'conversations': [],
})
- value['conversations'].append(self.key)
+ if self.key not in value['conversations']:
@johnsca

johnsca Dec 14, 2015

Owner

This is the fix.

+ """
+ Toggle the given state for this conversation.
+
+ If ``active`` is not given, the state will be flipped from its current
@mbruzek

mbruzek Dec 14, 2015

Contributor

Flipped is a bit confusing here, I would explicitly call out the state will be removed or set.

Contributor

mbruzek commented Dec 14, 2015

This looks like a great fix and was happy to see docstrings included! The "flipped" concept was a bit tough to get until I looked at the code and realized that it was just set_state() or remove_state(). Someone reading the just the docstring might not understand what happens in the code. Just a minor wording concern should not prevent this fix from landing.

+1 from me

mbruzek added a commit that referenced this pull request Dec 14, 2015

Merge pull request #41 from johnsca/dupe-state
Fix issue regarding duplicate state setting, and adding helpers

@mbruzek mbruzek merged commit 618fb90 into juju-solutions:master Dec 14, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment