skip checking if this is a new speaker

This commit is contained in:
Thomas Steen Rasmussen 2017-01-25 23:48:37 +01:00
parent daaa3128c8
commit 5432c07efb

View file

@ -10,7 +10,8 @@ def check_speaker_event_camp_consistency(sender, instance, **kwargs):
raise ValidationError({'events': 'One or more events belong to a different camp (%s) than the speaker (%s) does' % (event.camp, instance.camp)})
def check_speaker_camp_change(sender, instance, **kwargs):
for event in instance.events.all():
if event.camp != instance.camp:
raise ValidationError({'camp': 'You cannot change the camp a speaker belongs to if the speaker is associated with one or more events.'})
if instance.pk:
for event in instance.events.all():
if event.camp != instance.camp:
raise ValidationError({'camp': 'You cannot change the camp a speaker belongs to if the speaker is associated with one or more events.'})