write binary map history index
This commit is contained in:
parent
026926503c
commit
24a2fe9522
5 changed files with 64 additions and 17 deletions
|
@ -20,6 +20,7 @@ from django.utils.translation import ungettext_lazy
|
|||
from c3nav.editor.models.changedobject import ApplyToInstanceError, ChangedObject
|
||||
from c3nav.editor.utils import is_created_pk
|
||||
from c3nav.editor.wrappers import ModelInstanceWrapper, ModelWrapper
|
||||
from c3nav.mapdata.cache import changed_geometries
|
||||
from c3nav.mapdata.models import LocationSlug, MapUpdate
|
||||
from c3nav.mapdata.models.locations import LocationRedirect
|
||||
from c3nav.mapdata.utils.models import get_submodels
|
||||
|
@ -453,11 +454,12 @@ class ChangeSet(models.Model):
|
|||
changeset.save()
|
||||
elif self.direct_editing:
|
||||
with MapUpdate.lock():
|
||||
changed_geometries.reset()
|
||||
queries_before = len(connection.queries)
|
||||
yield self
|
||||
if any((q['sql'].startswith('UPDATE') or q['sql'].startswith('INSERT') or
|
||||
q['sql'].startswith('DELETE')) for q in connection.queries[queries_before:]):
|
||||
MapUpdate.objects.create(user=user, type='direct_edit')
|
||||
update = MapUpdate.objects.create(user=user, type='direct_edit')
|
||||
else:
|
||||
yield self
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue