Commit 83ab3948 authored by Michal Čihař's avatar Michal Čihař

Provide stable URLs for unit (as long as they exist)

parent c5cfaea8
......@@ -2065,7 +2065,7 @@ class Unit(models.Model):
)
def get_absolute_url(self):
return '%s?pos=%d&dir=stay' % (self.translation.get_translate_url(), self.position)
return '%s?checksum=%s' % (self.translation.get_translate_url(), self.checksum)
def update_from_unit(self, unit, pos, force, template = None):
'''
......
......@@ -1105,6 +1105,8 @@ def translate(request, project, subproject, lang):
units = allunits.filter(position__lt = pos).order_by('-position')
else:
units = allunits.filter(position__gt = pos)
elif 'checksum' in request.GET:
allunits = obj.unit_set.filter(checksum = request.GET['checksum'])
else:
allunits = obj.unit_set.filter_type(rqtype, obj)
# What unit set is about to show
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment