Ensure no-responses and sign-offs are character-agnostic, in addition to already being role-agnostic.
This commit is contained in:
parent
502698a501
commit
027fbb4ab3
1 changed files with 2 additions and 1 deletions
|
@ -114,8 +114,9 @@ class RaidResponse(models.Model):
|
||||||
self._original_status = self.status
|
self._original_status = self.status
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
# Make sure no-responses and sign-offs are role-agnostic, but all other responses are not
|
# Make sure no-responses and sign-offs are character- and role-agnostic, but all other responses are not
|
||||||
if self.status <= RaidResponse.Status.SIGNED_OFF:
|
if self.status <= RaidResponse.Status.SIGNED_OFF:
|
||||||
|
self.character = self.character.user.main
|
||||||
self.role = None
|
self.role = None
|
||||||
elif self.role is None:
|
elif self.role is None:
|
||||||
raise ValidationError({"role": "This field is required."})
|
raise ValidationError({"role": "This field is required."})
|
||||||
|
|
Loading…
Reference in a new issue