Mercurial > p > roundup > code
comparison roundup/cgi/actions.py @ 6301:45ba6b71f1cf
actions.py translation. Using mapping rather than tuple for args.
Format an error message in handleCollision using named tokens
'%(props)s' rather than printf positional format specifier %s.
Regenerate roundup.pot and update all .po files to use named tokens
in their trnslations.
Test handleCollision as well.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 20 Dec 2020 23:17:17 -0500 |
| parents | 15fd91fd3c4c |
| children | c4371ec7d1c0 |
comparison
equal
deleted
inserted
replaced
| 6300:778a9f455067 | 6301:45ba6b71f1cf |
|---|---|
| 807 return list(props[key]) | 807 return list(props[key]) |
| 808 else: | 808 else: |
| 809 return [] | 809 return [] |
| 810 | 810 |
| 811 def handleCollision(self, props): | 811 def handleCollision(self, props): |
| 812 message = self._('Edit Error: someone else has edited this %s (%s). ' | 812 message = self._( |
| 813 'View <a target="_blank" href="%s%s">their changes</a> ' | 813 'Edit Error: someone else has edited this %(klass)s (%(props)s). ' |
| 814 'in a new window.') % (self.classname, ', '.join(props), | 814 'View <a target="_blank" href="%(klass)s%(id)s">their changes</a> ' |
| 815 self.classname, self.nodeid) | 815 'in a new window.') % { "klass": self.classname, |
| 816 "props": ', '.join(props), | |
| 817 "id": self.nodeid} | |
| 816 self.client.add_error_message(message, escape=False) | 818 self.client.add_error_message(message, escape=False) |
| 817 return | 819 return |
| 818 | 820 |
| 819 def handle(self): | 821 def handle(self): |
| 820 """Perform an edit of an item in the database. | 822 """Perform an edit of an item in the database. |
