forked from fedora-copr/copr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: group alias need 1:1 mapping to group
When i was developing group supported in OIDC, i found some wired hehavior in group activated in fedora-copr#2825, So i submitted this PR, and @praiskup also give advice a TODO so i include the fix as well This PR try to fix: fedora-copr#2825 1. add unique contraint to fas_name and add migration script generated by alembic revision --autogenerate 2. I think macro fas_group_href canbe replaced by config.GROUP_INFO.link.forma which is more configurable 3. When creating a new alias for a group, if the group already has one alias, popup a flash and redirect to the already existed group Signed-off-by: Li Chaoran <[email protected]>
- Loading branch information
Showing
6 changed files
with
37 additions
and
18 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
frontend/coprs_frontend/alembic/versions/daa62cd0743d_add_unique_constraint_to_fas_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
add unique constraint to fas_group | ||
Revision ID: daa62cd0743d | ||
Revises: ba6ac0936bfb | ||
Create Date: 2023-08-01 09:52:01.522171 | ||
""" | ||
|
||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'daa62cd0743d' | ||
down_revision = 'ba6ac0936bfb' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_unique_constraint(None, 'group', ['fas_name']) | ||
|
||
|
||
def downgrade(): | ||
op.drop_constraint(None, 'group', type_='unique') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters