From 1e6445a0e52036f3b6beb0623b3e0d7f1013dfad Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 23 2015 22:01:29 +0000 Subject: Specify if the user is an admin or not on the settings page This is obvious as otherwise the user wouldn't be allowed but we need the variable in the template to avoid showing the `fork` button on a project the user has commit to already --- diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 112c364..fc66057 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -719,7 +719,8 @@ def view_settings(repo, username=None): if not repo: flask.abort(404, 'Project not found') - if not is_repo_admin(repo): + repo_admin = is_repo_admin(repo) + if not repo_admin: flask.abort( 403, 'You are not allowed to change the settings for this project') @@ -765,6 +766,7 @@ def view_settings(repo, username=None): tag_form=tag_form, tags=tags, plugins=plugins, + repo_admin=repo_admin, )