|
|
@ -26,7 +26,7 @@ class Objective(db.Model): |
|
|
|
self.hash = token_hex(16) |
|
|
|
self.hash = token_hex(16) |
|
|
|
|
|
|
|
|
|
|
|
def owned_by(self, user): |
|
|
|
def owned_by(self, user): |
|
|
|
'''given user is an owner of a game object is part of''' |
|
|
|
'''Returns True if given user is an owner of a game object is part of''' |
|
|
|
return user in [gameplayer.user for gameplayer in self.game.players if gameplayer.role == Role.owner] |
|
|
|
return user in [gameplayer.user for gameplayer in self.game.players if gameplayer.role == Role.owner] |
|
|
|
|
|
|
|
|
|
|
|
class ObjectiveMinimalEncoder(JSONEncoder): |
|
|
|
class ObjectiveMinimalEncoder(JSONEncoder): |
|
|
|