Skip to content

Commit

Permalink
If no value posted for onetoone field, we return None to delete the v…
Browse files Browse the repository at this point in the history
…alue from the DB
  • Loading branch information
LeResKP committed Jan 3, 2013
1 parent 8d75aa8 commit 538e48e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tw2/sqla/widgets.py
Expand Up @@ -122,7 +122,9 @@ def has_value(dic):
elif self.required_children: elif self.required_children:
if not has_value(value): if not has_value(value):
# No problem, no value posted. # No problem, no value posted.
return value # We return None to make sure we will delete the onetoone field
# or not create it
return None


error_dict = {} error_dict = {}
for c in self.required_children: for c in self.required_children:
Expand Down

0 comments on commit 538e48e

Please sign in to comment.