EventParticipation: Bugfix in save() method
This commit is contained in:
parent
5639c5fd82
commit
6431764858
|
@ -133,9 +133,13 @@ class EventParticipation( models.Model ):
|
||||||
return self.user.username
|
return self.user.username
|
||||||
|
|
||||||
def save( self, *args, **kwargs ):
|
def save( self, *args, **kwargs ):
|
||||||
prev = EventParticipation.objects.get( event = self.event, user = self.user )
|
prev = EventParticipation.objects.filter( event = self.event, user = self.user )
|
||||||
if prev.status != self.status or prev.comment != self.comment:
|
if len(prev) == 0:
|
||||||
super(EventParticipation,self).save( *args,**kwargs)
|
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
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue