Repository navigation
flows: use the brand's default background in flow_info - #28193
Open
pcbeingused33 wants to merge 3 commits into
Open
pcbeingused33 wants to merge 3 commits into
pcbeingused33 wants to merge 3 commits into
Conversation
Since goauthentik#21553 the flow executor no longer passed the request to Flow.background_url(), which is the only way the brand was reached, so flows without their own background always returned the stock image. Pass the brand explicitly and keep the URLs app-relative. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Deploy Preview for authentik-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28193 +/- ##
==========================================
- Coverage 93.80% 93.77% -0.03%
==========================================
Files 1262 1262
Lines 91705 91726 +21
Branches 5752 5752
==========================================
- Hits 86023 86019 -4
- Misses 5596 5621 +25
Partials 86 86
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
1 of 3 tasks
| self, | ||
| request: HttpRequest | None = None, | ||
| use_cache: bool = True, | ||
| brand: "Brand | None" = None, # noqa: UP037 |
Contributor
There was a problem hiding this comment.
This is the only noqa: UP037 in our whole system, and it should not be necessary. We target python 3.14 and above, and those later versions are annotations by default; did you build this with a deprecated version of python?
Resolve the flow_info conflict by passing the brand into the background helpers and keeping continuous_login_hold from main.
This branch has not been deployed
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.
Fixes #28189
Details
What does this PR change?
The flow executor uses the brand's default flow background and themed variants when a flow has no background of its own. It passes the brand explicitly to keep uploaded-file URLs app-relative.
FlowSerializerdeclaresbackground_urlas a read-only string field. This keeps the existing OpenAPI type and description and lets REST Framework call the same model method when serializing a flow.Why is this change needed?
Since #21553, the flow executor stopped passing the request to the background helpers, so the helpers could no longer find the brand.
The new
Brandparameter is imported only for type checking to avoid a circular import. With a generic read-only serializer field, drf-spectacular inspects all of the model method's annotations at runtime and raisesNameErrorwhen it tries to resolveBrand. Declaring the field type directly lets drf-spectacular generate the schema without inspecting the method signature.How was this tested?
NameError. The follow-up generated the schema successfully, and thebackground_urldefinitions forFlowandFlowSetmatched the checked-in schema.Linked issues
closes #28189
AI disclosure: Claude Code assisted with the original analysis, implementation, tests, and description. Codex assisted with diagnosing the CI failure, implementing the follow-up, validating it locally, and updating this draft.