Created
January 23, 2017 22:08
-
-
Save katiayn/25c21ee88765a2a2bb981324834cfe12 to your computer and use it in GitHub Desktop.
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
def form_valid(self, form): | |
self.instance = form.save(commit=False) | |
object = self.get_object() | |
if self.instance.is_biscuit and self.instance.is_coated_in_chocolate: | |
object.set_vat_20() | |
return super().form_valid(form) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment