summaryrefslogtreecommitdiff
path: root/chimere/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/forms.py')
-rw-r--r--chimere/forms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/chimere/forms.py b/chimere/forms.py
index 1d37b56..4e834d0 100644
--- a/chimere/forms.py
+++ b/chimere/forms.py
@@ -203,7 +203,7 @@ class MarkerAdminFormBase(forms.ModelForm):
Custom save method in order to manage associated properties
"""
new_marker = super(MarkerAdminFormBase, self).save(*args, **keys)
- if 'status' not in self.cleaned_data:
+ if 'status' not in self.cleaned_data and not new_marker.status:
new_marker.status = 'S'
if new_marker.status == 'A':
tz = UTC()
@@ -276,8 +276,8 @@ class RouteAdminForm(forms.ModelForm):
Custom save method in order to manage associated properties
"""
new_route = super(RouteAdminForm, self).save(*args, **keys)
- if 'status' not in self.cleaned_data:
- new_route.status = 'S'
+ if 'status' not in self.cleaned_data and not new_route.status:
+ new_marker.status = 'S'
new_route.save()
return new_route