This is an automated email from the ASF dual-hosted git repository. gcruz pushed a commit to branch gc/8496 in repository https://gitbox.apache.org/repos/asf/allura.git
commit 2e17b61511676fc82b4f8232c93524d2360a1eae Author: Guillermo Cruz <[email protected]> AuthorDate: Fri Feb 3 15:04:52 2023 -0600 [#8496] skip limit when adding a trove category if the current user is a site admin --- Allura/allura/ext/admin/admin_main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py index f49bc6dad..1ee723cc4 100644 --- a/Allura/allura/ext/admin/admin_main.py +++ b/Allura/allura/ext/admin/admin_main.py @@ -54,6 +54,7 @@ from . import widgets as aw import six + log = logging.getLogger(__name__) @@ -432,9 +433,10 @@ class ProjectAdminController(BaseController): trove_obj = M.TroveCategory.query.get(trove_cat_id=int(new_trove)) error_msg = None in_trove = False - if type in ['license', 'audience', 'developmentstatus', 'language'] and len(current_troves) >= 6: + if type in ['license', 'audience', 'developmentstatus', 'language'] and len( + current_troves) >= 6 and not h.is_site_admin(c.user): error_msg = 'You may not have more than 6 of this category.' - elif type in ['topic'] and len(current_troves) >= 3: + elif type in ['topic'] and len(current_troves) >= 3 and not h.is_site_admin(c.user): error_msg = 'You may not have more than 3 of this category.' elif trove_obj is not None: in_trove = trove_obj._id in current_troves
