Skip to content

Commit

Permalink
Define __hash__ for Responders model
Browse files Browse the repository at this point in the history
...so it can be used in hashable collection.

(This is a temporary patch to work around issue opsgenie#38)
  • Loading branch information
asqui committed Feb 3, 2020
1 parent b59b388 commit 5fceef1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions opsgenie_sdk/models/responder.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@ def __eq__(self, other):
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

def __hash__(self):
return hash(self.type + self.id)

0 comments on commit 5fceef1

Please sign in to comment.