Commit 29b96e78 authored by Michal Čihař's avatar Michal Čihař

Do not fail badly on invalid location

parent 320dcca2
......@@ -1287,7 +1287,14 @@ class Unit(models.Model):
return _('unit ID %s') % self.location
for location in self.location.split(','):
location = location.strip()
filename, line = location.split(':')
if location == '':
continue
location_parts = location.split(':')
if len(location_parts) == 2:
filename, line = location_parts
else:
filename = location_parts[0]
line = 0
link = self.translation.subproject.get_repoweb_link(filename, line)
if link is None:
ret.append('%s' % location)
......
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