skip checking if this is a new speaker
This commit is contained in:
parent
daaa3128c8
commit
5432c07efb
|
@ -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)})
|
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):
|
def check_speaker_camp_change(sender, instance, **kwargs):
|
||||||
for event in instance.events.all():
|
if instance.pk:
|
||||||
if event.camp != instance.camp:
|
for event in instance.events.all():
|
||||||
raise ValidationError({'camp': 'You cannot change the camp a speaker belongs to if the speaker is associated with one or more events.'})
|
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.'})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue