This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the following fields can only be updated when the is_disabled property is set to false | |
def clean_field_1(self): | |
if self.instance.is_disabled: | |
return self.instance.field_1 | |
else: | |
return self.cleaned_data.get('field_1') | |
def clean_field_2(self): | |
if self.instance.is_disabled: | |
return self.instance.field_2 | |
else: | |
return self.cleaned_data.get('field_2') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment