Skip to content

Comments

Refactor Kesäseteli to use configurable admin (site) group name#3849

Merged
nikomakela merged 2 commits intomainfrom
YJDH-733-refactor-ad-group-name
Jan 23, 2026
Merged

Refactor Kesäseteli to use configurable admin (site) group name#3849
nikomakela merged 2 commits intomainfrom
YJDH-733-refactor-ad-group-name

Conversation

@nikomakela
Copy link
Contributor

@nikomakela nikomakela commented Jan 22, 2026

YJDH-733.

Refactor staff_Admin_permissions (sub) app so that the admin group name can be configured and left as None (to disable the feature).

Management command python manage.py setup_admin_permissions reads the admin group from settings to setup admin permissions for that group.

@nikomakela nikomakela requested review from a team as code owners January 22, 2026 14:20
@azure-pipelines
Copy link

YJDH-KESASETELI-API branch is deployed to platta: https://yjdh-kesaseteli-pr3849.api.dev.hel.ninja 🚀🚀🚀

@nikomakela nikomakela force-pushed the YJDH-733-refactor-ad-group-name branch from 26b2b7b to 3eb7f1b Compare January 22, 2026 14:33
@azure-pipelines
Copy link

YJDH-KESASETELI-API branch is deployed to platta: https://yjdh-kesaseteli-pr3849.api.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

YOUTH branch is deployed to platta: https://nuortenkesaseteli-pr3849.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

TestCafe youth result is failed for https://nuortenkesaseteli-pr3849.dev.hel.ninja 😿💢💥💥

Comment on lines 54 to 56
# Ensure we use a valid group name
if not settings.AD_ADMIN_GROUP_NAME:
settings.AD_ADMIN_GROUP_NAME = "kesaseteli-admin"
Copy link
Collaborator

@karisal-anders karisal-anders Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like this for added robustness?

Suggested change
# Ensure we use a valid group name
if not settings.AD_ADMIN_GROUP_NAME:
settings.AD_ADMIN_GROUP_NAME = "kesaseteli-admin"
settings.AD_ADMIN_GROUP_NAME = "kesaseteli-admin"
Group.objects.filter(name=settings.AD_ADMIN_GROUP_NAME).delete()

Comment on lines 77 to 78
if not settings.AD_ADMIN_GROUP_NAME:
settings.AD_ADMIN_GROUP_NAME = "kesaseteli-admin"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the if:

Suggested change
if not settings.AD_ADMIN_GROUP_NAME:
settings.AD_ADMIN_GROUP_NAME = "kesaseteli-admin"
settings.AD_ADMIN_GROUP_NAME = "kesaseteli-admin"

Copy link
Collaborator

@karisal-anders karisal-anders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, please take a look at them. Please would you rebase on main to get rid of the ruff formatting change reversals (Aren't those the ones that already got changed in another PR just now).

@nikomakela
Copy link
Contributor Author

nikomakela commented Jan 23, 2026

Left some comments, please take a look at them. Please would you rebase on main to get rid of the ruff formatting change reversals (Aren't those the ones that already got changed in another PR just now).

Those are now included in this PR, since that PR was based on this one. I accidentally published them in 2 different PR.

YJDH-733.

Fixed code style and formatting:
1. Ran `ruff check --fix .` and manually fixed what was left.
2. Ran `ruff format .`
@nikomakela nikomakela force-pushed the YJDH-733-refactor-ad-group-name branch from 3eb7f1b to 4b015a5 Compare January 23, 2026 07:55
@azure-pipelines
Copy link

YJDH-KESASETELI-API branch is deployed to platta: https://yjdh-kesaseteli-pr3849.api.dev.hel.ninja 🚀🚀🚀

@sonarqubecloud
Copy link

@azure-pipelines
Copy link

EMPLOYER branch is deployed to platta: https://kesaseteli-pr3849.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

YOUTH branch is deployed to platta: https://nuortenkesaseteli-pr3849.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

HANDLER branch is deployed to platta: https://kesaseteli-handler-ui-pr3849.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

TestCafe result is success for https://kesaseteli-handler-ui-pr3849.dev.hel.ninja 😆🎉🎉🎉

@azure-pipelines
Copy link

TestCafe result is success for https://nuortenkesaseteli-pr3849.dev.hel.ninja 😆🎉🎉🎉

@azure-pipelines
Copy link

TestCafe result is success for https://kesaseteli-pr3849.dev.hel.ninja 😆🎉🎉🎉

@nikomakela nikomakela merged commit ccb14db into main Jan 23, 2026
73 checks passed
@nikomakela nikomakela deleted the YJDH-733-refactor-ad-group-name branch January 23, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants