Skip to content

Comments

Configure yearly summer voucher parameters and email templates from admin site#3834

Merged
nikomakela merged 19 commits intomainfrom
YJDH-694-admin-config
Jan 20, 2026
Merged

Configure yearly summer voucher parameters and email templates from admin site#3834
nikomakela merged 19 commits intomainfrom
YJDH-694-admin-config

Conversation

@nikomakela
Copy link
Contributor

@nikomakela nikomakela commented Jan 9, 2026

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

YJDH-HELSINKILISA-API branch is deployed to platta: https://helsinkilisa-pr3834.api.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

APPLICANT is deployed to platta: https://helsinkilisa-ui-pr3834.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

TestCafe result is success for https://helsinkilisa-ui-pr3834.dev.hel.ninja 😆🎉🎉🎉

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

YJDH-HELSINKILISA-API branch is deployed to platta: https://helsinkilisa-pr3834.api.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

APPLICANT is deployed to platta: https://helsinkilisa-ui-pr3834.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

TestCafe employer result is failed for https://kesaseteli-pr3834.dev.hel.ninja 😿💢💥💥

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

TestCafe result is success for https://helsinkilisa-ui-pr3834.dev.hel.ninja 😆🎉🎉🎉

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

YJDH-HELSINKILISA-API branch is deployed to platta: https://helsinkilisa-pr3834.api.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

TestCafe result is success for https://helsinkilisa-ui-pr3834.dev.hel.ninja 😆🎉🎉🎉

@azure-pipelines
Copy link

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

YJDH-694.

Implemented a database-driven email system using a new EmailTemplate
model, replacing hardcoded strings. This change allows content to be
managed directly via the Django Admin.

Key additions:
- A restoration system (management command & Admin button) to sync
templates from files to the database.
- An admin action to reinitialize existing templates from source files.
- An admin action to send preview emails to currently logged in user.
- Updated application logic to source content from the database.
- New tests covering the service logic and management commands.

Add preview functionality for email templates in Django admin interface:
 - Add preview view in admin with mock context generation
- Implement template syntax validation for subject, HTML body, and text
body
- Create MockContextService to generate mock contexts for different
template types
- Add custom admin templates for preview UI

Also, make it possible to send selected email previews to your own mail
box.

Regenerate email text body on every template save: Make `body_text`
field read only and always regenerate it (from `html_body`) on save.

WIP
YJDH-694.

Add references to submodules in the Kesaseteli's root README. Add
documentation for yearly summer voucher configuration and email
templates management.
YJDH-694.

Convert TargetGroupValidationService methods to static methods.

Since TargetGroupValidationService validation logic is purely functional
and doesn't rely on any instance state, staticmethod is the correct and
more pythonic choice.
YJDH-694.

Add description property to target group sub classes to be used to
explain to admin user, what the rules are for validation.

Add the description proeprty also to target group serializer.
YJDH-694.

Add a custom admin site to Kesäseteli.

Context Injection: The each_context method injects
password_login_disabled (boolean) into the template context. This allows
hel_login.html to conditionally hide the login form.

Login View Override: The login method checks PASSWORD_LOGIN_DISABLED
setting. If True, it raises PermissionDenied, effectively blocking the
authentication method for the admin site.
YJDH-694.

Add a custom admin site to Kesäseteli.

Context Injection: The each_context method injects
password_login_disabled (boolean) into the template context. This allows
hel_login.html to conditionally hide the login form.

Login View Override: The login method checks PASSWORD_LOGIN_DISABLED
setting. If True, it raises PermissionDenied, effectively blocking the
authentication method for the admin site.
@nikomakela nikomakela force-pushed the YJDH-694-admin-config branch from 877bf69 to 8d5f829 Compare January 20, 2026 15:22
@sonarqubecloud
Copy link

@azure-pipelines
Copy link

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

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed for 'yjdh'

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

APPLICANT is deployed to platta: https://helsinkilisa-ui-pr3834.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

YJDH-HELSINKILISA-API branch is deployed to platta: https://helsinkilisa-pr3834.api.dev.hel.ninja 🚀🚀🚀

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

TestCafe result is success for https://helsinkilisa-ui-pr3834.dev.hel.ninja 😆🎉🎉🎉

@azure-pipelines
Copy link

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

@azure-pipelines
Copy link

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

1 similar comment
@azure-pipelines
Copy link

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

@nikomakela nikomakela merged commit e81f712 into main Jan 20, 2026
127 of 130 checks passed
@nikomakela nikomakela deleted the YJDH-694-admin-config branch January 20, 2026 16:07
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