-
+ |
{{ team }}
|
diff --git a/frontend/coprs_frontend/coprs/views/groups_ns/groups_general.py b/frontend/coprs_frontend/coprs/views/groups_ns/groups_general.py
index 43194250e..ac15e0a1e 100644
--- a/frontend/coprs_frontend/coprs/views/groups_ns/groups_general.py
+++ b/frontend/coprs_frontend/coprs/views/groups_ns/groups_general.py
@@ -10,6 +10,7 @@
from coprs.logic.coprs_logic import CoprsLogic, PinnedCoprsLogic
from coprs.logic.users_logic import UsersLogic
from coprs import app
+from coprs.oidc import oidc_enabled
from ... import db
from ..misc import login_required
@@ -31,7 +32,7 @@ def activate_group(fas_group):
if fas_group not in flask.g.user.user_teams:
raise InsufficientRightsException(
- "User '{}' doesn't have access to fas group {}"
+ "User '{}' doesn't have access to group {}"
.format(flask.g.user.username, fas_group))
alias = form.name.data
@@ -41,12 +42,16 @@ def activate_group(fas_group):
db.session.add(group)
db.session.commit()
- flask.flash(
- "FAS group {} is activated in the Copr under the alias {} "
- .format(fas_group, alias)
- )
+ # can't have more than one alias for a group
+ if group.name != alias:
+ message = "Group {} already activated as alias {} ".format(
+ fas_group, group.name)
+ else:
+ message = "Group {} is activated in the System under the alias {} ".format(
+ fas_group, alias)
+ flask.flash(message)
return flask.redirect(url_for(
- "groups_ns.list_projects_by_group", group_name=alias))
+ "groups_ns.list_projects_by_group", group_name=group.name))
else:
return flask.render_template(
@@ -85,7 +90,7 @@ def list_projects_by_group(group_name, page=1):
@groups_ns.route("/list/my")
@login_required
def list_user_groups():
- if not (app.config['FAS_LOGIN'] or app.config['LDAP_URL']):
+ if not (app.config['FAS_LOGIN'] or app.config['LDAP_URL'] or oidc_enabled(app.config)):
raise ObjectNotFound("Fedora Accounts or LDAP groups not enabled")
teams = flask.g.user.user_teams
|