diff --git a/eventplanner/models.py b/eventplanner/models.py index 4b022e1..10eed04 100644 --- a/eventplanner/models.py +++ b/eventplanner/models.py @@ -133,9 +133,13 @@ class EventParticipation( models.Model ): return self.user.username def save( self, *args, **kwargs ): - prev = EventParticipation.objects.get( event = self.event, user = self.user ) - if prev.status != self.status or prev.comment != self.comment: + prev = EventParticipation.objects.filter( event = self.event, user = self.user ) + if len(prev) == 0: super(EventParticipation,self).save( *args,**kwargs) + else: + prev = prev[0] + if prev.status != self.status or prev.comment != self.comment: + super(EventParticipation,self).save( *args,**kwargs) @staticmethod