Fix event settings form considered changed even if unchanged (#1739)

Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
Felix Rindt
2021-12-16 11:27:18 +01:00
committed by GitHub
parent ad2943263c
commit 94a7d02ab1
3 changed files with 70 additions and 24 deletions

View File

@@ -273,6 +273,11 @@ class RelativeDateTimeField(forms.MultiValueField):
minutes_before=None
))
def has_changed(self, initial, data):
if initial is None:
initial = self.widget.decompress(initial)
return super().has_changed(initial, data)
def clean(self, value):
if value[0] == 'absolute' and not value[1]:
raise ValidationError(self.error_messages['incomplete'])