Created
April 9, 2014 15:08
-
-
Save jakul/10281171 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
if numbers.count() > 0: | |
phone_no_1 = numbers[0] | |
else: | |
phone_no_1 = PhoneNumber() | |
phone_no_1.content_object = self.instance.user | |
phone_no_1.number = self.cleaned_data['phone_no_1'] | |
# ensure this one is marked as the default one | |
phone_no_1.is_default = True | |
phone_no_1.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment