summaryrefslogtreecommitdiff
path: root/chimere/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-14 20:38:31 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-14 20:38:31 +0200
commit57d9387d21d324f9a4830aad1607c07a90c5655c (patch)
treebae8b3b1f332cfcad6838405f0496f94811ca399 /chimere/forms.py
parentc41d683140f9611b5faff4ad1e22affb580c0e13 (diff)
parentf2a7d925feeaa8d3a27d61b0fb9fcacca7ca3837 (diff)
downloadChimère-57d9387d21d324f9a4830aad1607c07a90c5655c.tar.bz2
Chimère-57d9387d21d324f9a4830aad1607c07a90c5655c.zip
Merge branch 'v2.9'
Diffstat (limited to 'chimere/forms.py')
-rw-r--r--chimere/forms.py19
1 files changed, 1 insertions, 18 deletions
diff --git a/chimere/forms.py b/chimere/forms.py
index 8b86df1..0187564 100644
--- a/chimere/forms.py
+++ b/chimere/forms.py
@@ -559,32 +559,15 @@ class RouteForm(RouteAdminForm):
def save(self, *args, **keys):
"""
- Custom save method in order to manage associated marker and file
+ Custom save method in order to manage associated file
"""
new_route = super(RouteForm, self).save(*args, **keys)
- if new_route.status == 'S':
- new_route.has_associated_marker = True
- new_route.save()
# associate a route file
if 'associated_file_id' in self.cleaned_data and \
self.cleaned_data['associated_file_id']:
file_pk = int(self.cleaned_data['associated_file_id'])
new_route.associated_file = RouteFile.objects.get(pk=file_pk)
new_route.save()
- # change the associated marker (if available)
- q_new_marker = Marker.objects.filter(route=new_route)
- if not q_new_marker.count():
- return new_route
- new_marker = q_new_marker.all()[0]
- # save description
- if self.cleaned_data['description']:
- new_marker.description = self.cleaned_data['description']
- new_marker.save()
- # save properties
- properties = dict(
- [(k.split('_')[-1], self.cleaned_data[k])
- for k in self.cleaned_data.keys() if k.startswith('property_')])
- new_marker.saveProperties(properties)
return new_route