From 8ede9ec96f28d25d3a8b0010ff0c43d7851e6911 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 30 2017 15:34:20 +0000 Subject: No need to check the number of groups for the admins and small style change Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/__init__.py b/pagure/__init__.py index 078073b..f1ee87d 100644 --- a/pagure/__init__.py +++ b/pagure/__init__.py @@ -273,7 +273,7 @@ def is_admin(): auth_method = APP.config.get('PAGURE_AUTH', None) if auth_method == 'fas': - if not user.cla_done or len(user.groups) < 1: + if not user.cla_done: return False admin_users = APP.config.get('PAGURE_ADMIN_USERS', []) @@ -283,7 +283,7 @@ def is_admin(): return True admins = APP.config['ADMIN_GROUP'] - if isinstance(admins, basestring): + if not isinstance(admins, list): admins = [admins] admins = set(admins or []) groups = set(flask.g.fas_user.groups)