Skip to content

stages/prompt: preserve empty initial values - #25148

Merged
BeryJu merged 6 commits into
goauthentik:mainfrom
tungyhardDevOps:fix/user-write-only-on-change
Nov 5, 2026
Merged

BeryJu merged 6 commits into
goauthentik:mainfrom
tungyhardDevOps:fix/user-write-only-on-change

Conversation

@tungyhardDevOps

Copy link
Copy Markdown
Contributor

Details

What does this PR change?

Preserves empty initial values as defaults when creating read-only prompt fields. This allows optional read-only text and text-area prompts whose initial value expression returns an empty string to be submitted successfully.

Adds a regression test covering a non-required read-only prompt with an empty initial value.

Why is this change needed?

Read-only prompt fields already set allow_blank=True, but the empty initial value was dropped because defaults were only assigned when they were truthy.As a result, an empty string was not retained as the read-only field's default and user settings flows could reject the field with "This field may not be
blank."

How was this tested?

  • Added test_read_only_blank_value to verify that an optional read-only prompt
    preserves an empty default and validates an empty submission.
  • Ran Python syntax compilation for the changed files.
  • Ran git diff --check.

The focused Django test suite was not run locally because the available Python
runtime did not include the project test dependencies.

Linked issues

closes #18899


Checklist

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)

@tungyhardDevOps
tungyhardDevOps requested a review from a team as a code owner August 17, 2026 11:48
@codecov

codecov Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.97%. Comparing base (c4731a8) to head (b5e4e2c).
⚠️ Report is 750 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25148      +/-   ##
==========================================
+ Coverage   92.00%   92.97%   +0.96%     
==========================================
  Files        1175     1229      +54     
  Lines       76348    85697    +9349     
  Branches     4056     4894     +838     
==========================================
+ Hits        70247    79675    +9428     
+ Misses       6059     5935     -124     
- Partials       42       87      +45     
Flag Coverage Δ
conformance 30.46% <0.00%> (-2.96%) ⬇️
e2e 35.17% <18.18%> (-3.06%) ⬇️
integration 27.63% <0.00%> (-2.58%) ⬇️
rust 51.12% <ø> (+8.22%) ⬆️
unit 94.53% <100.00%> (+0.96%) ⬆️
unit-migrate 94.53% <100.00%> (+0.96%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 178644d
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a82f5213af8500008ca876d
😎 Deploy Preview https://deploy-preview-25148--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 178644d
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a82f5213188880008d7666e
😎 Deploy Preview https://deploy-preview-25148--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 178644d
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a82f52132aa9a00082458d9
😎 Deploy Preview https://deploy-preview-25148--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit b5e4e2c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6aec8b2ee3608376018a7ef4
😎 Deploy Preview https://deploy-preview-25148--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit b5e4e2c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6aec8b2e500e1620e787a33c
😎 Deploy Preview https://deploy-preview-25148--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit b5e4e2c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6aec8b2e0f7e84f552d5cca8
😎 Deploy Preview https://deploy-preview-25148--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@tungyhardDevOps
tungyhardDevOps force-pushed the fix/user-write-only-on-change branch 4 times, most recently from 5a8a64a to e791798 Compare August 18, 2026 15:16
@tungyhardDevOps
tungyhardDevOps force-pushed the fix/user-write-only-on-change branch from e791798 to bd6f881 Compare August 18, 2026 15:56
@rissson

rissson commented Aug 19, 2026

Copy link
Copy Markdown
Member

hiya, there is no need to keep merging main here. We'll get to reviewing this when we can.

@tungyhardDevOps

Copy link
Copy Markdown
Contributor Author

hiya, there is no need to keep merging main here. We'll get to reviewing this when we can.

alright thanks for the feedback

@rissson
rissson requested a review from BeryJu August 21, 2026 13:24
@rissson rissson changed the title Fix/user write only on change stages/prompt: preserve empty initial values Aug 21, 2026
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in authentik Core Aug 21, 2026
@rissson rissson moved this from In Progress to Needs review in authentik Core Aug 21, 2026
@github-project-automation github-project-automation Bot moved this from Needs review to In Progress in authentik Core Aug 21, 2026
@BeryJu
BeryJu merged commit 9c0972e into goauthentik:main Nov 5, 2026
163 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Nov 5, 2026
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
* main: (313 commits)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  providers/oauth2: sign tokens with ML-DSA keys (#27172)
  sources/oauth: verify ML-DSA signed tokens (#27170)
  web: bump postcss from 8.5.18 to 8.5.32 in /website (#27602)
  web: bump postcss from 8.5.16 to 8.5.32 in /web (#27604)
  web/element: fix missing line break between elapsed time and displayed time. (#27624)
  web/elements: rename ak-codemirror to ak-code-editor (#27406)
  website/integrations: add Google Cloud Workforce Identity Federation guide (#27571)
  root: test that FIPS mode refuses non-approved algorithms (#27536)
  web: bump nanoid from 3.3.16 to 3.3.20 in /website (#27599)
  web: bump baseline-browser-mapping from 2.10.43 to 2.11.35 in /website (#27600)
  web: bump mermaid from 11.16.1 to 11.17.2 in /web (#27603)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
* main: (1729 commits)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  providers/oauth2: sign tokens with ML-DSA keys (#27172)
  sources/oauth: verify ML-DSA signed tokens (#27170)
  web: bump postcss from 8.5.18 to 8.5.32 in /website (#27602)
  web: bump postcss from 8.5.16 to 8.5.32 in /web (#27604)
  web/element: fix missing line break between elapsed time and displayed time. (#27624)
  web/elements: rename ak-codemirror to ak-code-editor (#27406)
  website/integrations: add Google Cloud Workforce Identity Federation guide (#27571)
  root: test that FIPS mode refuses non-approved algorithms (#27536)
  web: bump nanoid from 3.3.16 to 3.3.20 in /website (#27599)
  web: bump baseline-browser-mapping from 2.10.43 to 2.11.35 in /website (#27600)
  web: bump mermaid from 11.16.1 to 11.17.2 in /web (#27603)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
* main: (28 commits)
  events: bundle DB-IP Lite GeoIP databases instead of MaxMind GeoLite2 (#27102)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  providers/oauth2: sign tokens with ML-DSA keys (#27172)
  sources/oauth: verify ML-DSA signed tokens (#27170)
  web: bump postcss from 8.5.18 to 8.5.32 in /website (#27602)
  web: bump postcss from 8.5.16 to 8.5.32 in /web (#27604)
  web/element: fix missing line break between elapsed time and displayed time. (#27624)
  web/elements: rename ak-codemirror to ak-code-editor (#27406)
  website/integrations: add Google Cloud Workforce Identity Federation guide (#27571)
  root: test that FIPS mode refuses non-approved algorithms (#27536)
  web: bump nanoid from 3.3.16 to 3.3.20 in /website (#27599)
  web: bump baseline-browser-mapping from 2.10.43 to 2.11.35 in /website (#27600)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
…b-controller' into web/admin/breadcrumb-controller

* refs/remotes/origin/web/admin/breadcrumb-controller: (214 commits)
  The updated format for crumbs required an update to the unit tests.
  web/admin: Add a Breadcrumb context manager to the navigation suite
  Adding the Breadcrumbs visual component.
  Revised naming code to track certain features.
  web/elements: vendor sidebar and add icons (#27289)
  providers/oauth2: don't set state in responses if not supplied (#9735)
  web/elements: expansion visual hierarchy (#27562)
  providers/oauth2: accept ML-DSA keys for DPoP (#27174)
  website/docs: draft 2026.11 release notes (#26814)
  sources/ldap: store the directory date when resetting a password (#27578)
  events: bundle DB-IP Lite GeoIP databases instead of MaxMind GeoLite2 (#27102)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 (#27627)
  ...
kensternberg-authentik added a commit that referenced this pull request Nov 5, 2026
…k-controller

* web/admin/breadcrumb-controller: (215 commits)
  Changes requested by reviewer (@GirlBossRush).
  The updated format for crumbs required an update to the unit tests.
  web/admin: Add a Breadcrumb context manager to the navigation suite
  Adding the Breadcrumbs visual component.
  Revised naming code to track certain features.
  web/elements: vendor sidebar and add icons (#27289)
  providers/oauth2: don't set state in responses if not supplied (#9735)
  web/elements: expansion visual hierarchy (#27562)
  providers/oauth2: accept ML-DSA keys for DPoP (#27174)
  website/docs: draft 2026.11 release notes (#26814)
  sources/ldap: store the directory date when resetting a password (#27578)
  events: bundle DB-IP Lite GeoIP databases instead of MaxMind GeoLite2 (#27102)
  web/admin: fix ldap source parent group form (#26421)
  stages/prompt: preserve empty initial values (#25148)
  core: batch expired cache and channel record cleanup (#27587)
  web: bump mermaid from 11.16.0 to 12.3.0 in /website (#27598)
  ci: bump taiki-e/install-action from 2.89.0 to 2.89.1 in /.github/actions/setup (#27630)
  core: bump goauthentik/fips-python from `d4c46c4` to `69e7058` in /lifecycle/container (#27626)
  ci: bump AndreKurait/docker-cache from 0.7.0 to 0.7.1 in /.github/actions/setup (#27628)
  ci: bump actions-rust-lang/setup-rust-toolchain from 2.0.0 to 2.0.1 in /.github/actions/setup (#27629)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Authentik 2025.10.3 - Read-only field - Is 'allow blank' really working?

3 participants