Compare commits
2 Commits
b23f379db0
...
c7de08ca49
| Author | SHA1 | Date | |
|---|---|---|---|
| c7de08ca49 | |||
| 41e4b23317 |
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
from copy import deepcopy
|
||||
|
||||
from django.shortcuts import render
|
||||
|
||||
@@ -347,6 +348,7 @@ def create_or_change_route_ajax(request, route_id=None):
|
||||
lang = get_and_set_lang(request)
|
||||
|
||||
Dict = {}
|
||||
route_old_Dict = None
|
||||
|
||||
try:
|
||||
|
||||
@@ -361,6 +363,7 @@ def create_or_change_route_ajax(request, route_id=None):
|
||||
if route:
|
||||
form = RouteForm(data, instance=route)
|
||||
Dict.update({'route': route})
|
||||
route_old_Dict = deepcopy(route.__dict__)
|
||||
else:
|
||||
form = RouteForm(data)
|
||||
|
||||
@@ -381,6 +384,16 @@ def create_or_change_route_ajax(request, route_id=None):
|
||||
if obj.to_address_point:
|
||||
obj.to_city = get_city_by_type_transport_and_address_point(obj.type_transport, obj.to_address_point)
|
||||
|
||||
if route_old_Dict:
|
||||
if route_old_Dict['highlight_color'] != obj.highlight_color:
|
||||
obj.highlight_color = route_old_Dict['highlight_color']
|
||||
|
||||
if route_old_Dict['highlight_end_DT'] != obj.highlight_end_DT:
|
||||
obj.highlight_end_DT = route_old_Dict['highlight_end_DT']
|
||||
|
||||
if route_old_Dict['rising_DT'] != obj.rising_DT:
|
||||
obj.rising_DT = route_old_Dict['rising_DT']
|
||||
|
||||
obj.owner = request.user
|
||||
obj.save()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user