Mercurial > p > roundup > code
comparison roundup/admin.py @ 7650:4de48eadf5f4
bug: Fix roundup-admin security command. Lowercase optionalarg.
Roles are indexed by lower case role name. So 'security User' and
'security user' should generate the same output. Also add testing for
this case.
Thread:
https://sourceforge.net/p/roundup/mailman/roundup-users/thread/CAH-41398iTPhze7D_pZB8tqTBHF%3Dq6HYonbcG%2B%2BYN-ioDssXBw%40mail.gmail.com/#msg41557225
starting from:
https://sourceforge.net/p/roundup/mailman/message/41557225/
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 06 Oct 2023 09:53:22 -0400 |
| parents | 8329b2227adb |
| children | 5b41018617f2 |
comparison
equal
deleted
inserted
replaced
| 7649:771d7c43c76f | 7650:4de48eadf5f4 |
|---|---|
| 1713 typos. | 1713 typos. |
| 1714 """ | 1714 """ |
| 1715 if len(args) == 1: | 1715 if len(args) == 1: |
| 1716 role = args[0] | 1716 role = args[0] |
| 1717 try: | 1717 try: |
| 1718 roles = [(args[0], self.db.security.role[args[0]])] | 1718 roles = [(args[0].lower(), |
| 1719 self.db.security.role[args[0].lower()])] | |
| 1719 except KeyError: | 1720 except KeyError: |
| 1720 sys.stdout.write(_('No such Role "%(role)s"\n') % locals()) | 1721 sys.stdout.write(_('No such Role "%(role)s"\n') % locals()) |
| 1721 return 1 | 1722 return 1 |
| 1722 else: | 1723 else: |
| 1723 roles = list(self.db.security.role.items()) | 1724 roles = list(self.db.security.role.items()) |
