Store coords for nodes even if the weren't modified

This commit is contained in:
Ilya Zverev 2016-04-07 17:02:42 +03:00
parent 77246c35b8
commit 53ed3bf8c9
3 changed files with 5 additions and 6 deletions

View file

@ -165,7 +165,7 @@ def record_obj_diff(changeset, obj, prev, anomalies):
anomalies[prev['type'][0] + 'd'] += 1
else:
# Both objects are present, compare them
if 'coords' not in obj or obj['coords'] == prev['coords']:
if 'coords' not in obj:
coords = None
else:
coords = (prev['coords'], obj['coords'])

View file

@ -31,7 +31,10 @@ class Change(peewee.Model):
def changed_coord(self):
if self.action == 'a':
return None
return json.loads(self.changes)[0]
c = json.loads(self.changes)[0]
if self.action == 'm':
return c[1]
return c
def changed_tags(self):
if self.action == 'a':

View file

@ -90,10 +90,6 @@
</sup>
{% endif %}
<table>
{% set coord = change.changed_coord() %}
{% if coord %}
<tr class="create"><td>coord</td><td></td><td>{{ coord[0] }}, {{ coord[1] }}</td></tr>
{% endif %}
{% for key, value in change.changed_tags().iteritems() %}
<tr class="{{ value[2] }}"><td>{{ key }}</td><td>{{ '' if value[0] == value[1] else (value[0] or '') }}</td><td>{{ value[1] or '' }}</td></tr>
{% endfor %}