custom program certificates#29
Merged
muhammadammar-ma merged 5 commits intoulmo/fbrfrom Apr 1, 2026
Merged
Conversation
ahmed-arb
approved these changes
Apr 1, 2026
ahmed-arb
left a comment
There was a problem hiding this comment.
Looks good to me. Could you please add a bit more detailed PR description?
a83579a to
88cb5fe
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CertificateAssetmodel for uploading and referencing images, fonts, and CSS in certificate templates via a{% certificate_asset_url 'slug' %}template tagcredentials.custom_program_certificate_templateswaffle switch for safe rolloutDetails
New Models
ProgramCertificateTemplate— Stores Django template HTML with optional organization scoping. Template selection follows a priority hierarchy:Unique constraints enforce a single active template per scope, preventing ambiguous lookups.
CertificateAsset— Stores uploadable files (images, fonts, CSS) identified by a unique slug. Templates reference assets using{% load certificate_assets %}{% certificate_asset_url 'my-slug' %}, which gracefully degrades to an empty string with a logged warning if the slug is missing.Admin Interface
ProgramCertificateTemplateAdminwith autocomplete fields, search by org key/program UUID, and fieldsets separating configuration from template HTML editingCertificateAssetAdminwith slug-based lookup, read-only asset URL preview, and upload guidanceFeature Toggle
Waffle switch
credentials.custom_program_certificate_templates(default: off). When enabled, the rendering path checks for a database template before falling back to file-based templates.Test plan
credentials.custom_program_certificate_templatesCertificateAssetvia Django admin and verify the upload path and URL previewProgramCertificateTemplatevia Django admin with template HTML referencing an asset slug