web/admin/bugfix: Edit Stage not working. Invoking IdentificationStageForm not working#20429
Conversation
…eForm not working. ## What 1. Fix the field being referenced by Flows -\> \[One Flow\] -\> StageBindings -\> \[Edit Stage\] to use the PK for the *stage*, rather than the *binding*. 2. Added a check in `StrictUnsafe`: if the property is “wrapped” and untyped, treat it as an attribute, not a property. 3. Edit the `ak-bound-stages-list` target attribute to be an attribute, not a property. ## Why 1. This looks like a simple typo. To avoid this in the future, *we need tests*. 2. `ModelForm` uses both a converter and get/set accessors to manage the pk (primary key) of the object it is being invoked to edit: the first because Django primary keys can be either strings or numbers, and the latter because we have special transactional requirements when a primary key changes. Lit’s magic for handling this creates some weirdness around JavaScript prototyping (`wrapped` becomes the only key on the object; all the other keys become delegated to a prototype object), so `hasOwn()` can’t be used; we just have to check for `wrapped` and `!type`. 3. PKs are either strings or numbers, and ModelForm has a smart converter. There’s no need to shove the values around as properties and, in fact, that’ll break some things because there’s a working `attribute` field on ModelForm! Removing the `.` property marker both avoids this issue and makes visible exactly what item-id is being referenced.
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| ${StrictUnsafe<CustomFormElementTagName>(item.stageObj?.component, { | ||
| slot: "form", | ||
| instancePk: item.pk, | ||
| instancePk: item.stageObj?.pk, |
There was a problem hiding this comment.
This looks like a simple typo. To avoid this in the future, we need tests.
| <div class="pf-c-card"> | ||
| <div class="pf-c-card__body"> | ||
| <ak-bound-stages-list .target=${this.flow.pk}> </ak-bound-stages-list> | ||
| <ak-bound-stages-list target=${this.flow.pk}> </ak-bound-stages-list> |
There was a problem hiding this comment.
PKs are either strings or numbers, and ModelForm has a smart converter. There's no need to shove the values around as properties and, in fact, that'll break some things because there's a working attribute field on ModelForm.pk! Removing the . property marker both avoids this issue and makes visible exactly what item-id is being referenced.
| if ("wrapped" in propDeclaration && propDeclaration.wrapped && !propDeclaration.type) { | ||
| return Prefix.Attribute; | ||
| } | ||
|
|
There was a problem hiding this comment.
ModelForm uses both a converter and get/set accessors to manage the pk (primary key) of the object it is being invoked to edit: the first because Django primary keys can be either strings or numbers, and the latter because we have special transactional requirements when a primary key changes. Lit's magic for handling this creates some weirdness around JavaScript prototyping (wrapped becomes the only key on the object; all the other keys become delegated to a prototype object), so hasOwn() can't be used; we just have to check for wrapped and !type.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20429 +/- ##
==========================================
+ Coverage 93.26% 93.27% +0.01%
==========================================
Files 981 981
Lines 55161 55161
==========================================
+ Hits 51448 51454 +6
+ Misses 3713 3707 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
* main: website/integrations: update wazuh acs url (#20401)
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-bba9890e169f20c03879aa68134f62cba7e78c66
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-bba9890e169f20c03879aa68134f62cba7e78c66Afterwards, run the upgrade commands from the latest release notes. |
…ionship * main: core: bump msgraph-sdk from 1.54.0 to 1.55.0 (#20432) core: bump aws-cdk-lib from 2.238.0 to 2.239.0 (#20434) core: bump constructs from 10.5.0 to 10.5.1 (#20433) core: bump goauthentik/fips-python from `c272691` to `d973c46` in /lifecycle/container (#20437) core: bump goauthentik/fips-debian from `b0917af` to `4419749` in /lifecycle/container (#20438) web/admin/bugfix: Edit Stage not working. Invoking IdentificationStageForm not working (#20429) core: bump ruff from 0.15.1 to 0.15.2 (#20435) enterprise/providers/microsoft_entra: only check upn when set (#20441) core: bump selenium from 4.40.0 to 4.41.0 (#20436) website/docs: change permission name from 'Can view Admin interface' to 'Can access…' (#20412) website/integrations: add OIDC and update SAML instructions for Zammad (#20421) website/integrations: update wazuh acs url (#20401) web: Center footer links. (#20345)
* main: (29 commits) web/flow: refactor flow executor so component selection is in an easy-to-maintain table (#19999) website/integrations: gatus: fix config block (#20446) core: bump msgraph-sdk from 1.54.0 to 1.55.0 (#20432) core: bump aws-cdk-lib from 2.238.0 to 2.239.0 (#20434) core: bump constructs from 10.5.0 to 10.5.1 (#20433) core: bump goauthentik/fips-python from `c272691` to `d973c46` in /lifecycle/container (#20437) core: bump goauthentik/fips-debian from `b0917af` to `4419749` in /lifecycle/container (#20438) web/admin/bugfix: Edit Stage not working. Invoking IdentificationStageForm not working (#20429) core: bump ruff from 0.15.1 to 0.15.2 (#20435) enterprise/providers/microsoft_entra: only check upn when set (#20441) core: bump selenium from 4.40.0 to 4.41.0 (#20436) website/docs: change permission name from 'Can view Admin interface' to 'Can access…' (#20412) website/integrations: add OIDC and update SAML instructions for Zammad (#20421) website/integrations: update wazuh acs url (#20401) web: Center footer links. (#20345) core: bump goauthentik.io/api/v3 to 3.2026.5.0-rc1-1771349690 (#20367) ci: bump tj-actions/changed-files from 47.0.3 to 47.0.4 (#20374) ci: bump helm/kind-action from 1.13.0 to 1.14.0 (#20375) core: bump library/golang from 1.25.5-trixie to 1.26.0-trixie in /lifecycle/container (#20381) core: bump goauthentik/fips-debian from `10dadf1` to `b0917af` in /lifecycle/container (#20382) ...
* main: (30 commits) web/flow: generate a single API object for network transactions and use it for the lifetime of the FlowExecutor (#20030) web/flow: refactor flow executor so component selection is in an easy-to-maintain table (#19999) website/integrations: gatus: fix config block (#20446) core: bump msgraph-sdk from 1.54.0 to 1.55.0 (#20432) core: bump aws-cdk-lib from 2.238.0 to 2.239.0 (#20434) core: bump constructs from 10.5.0 to 10.5.1 (#20433) core: bump goauthentik/fips-python from `c272691` to `d973c46` in /lifecycle/container (#20437) core: bump goauthentik/fips-debian from `b0917af` to `4419749` in /lifecycle/container (#20438) web/admin/bugfix: Edit Stage not working. Invoking IdentificationStageForm not working (#20429) core: bump ruff from 0.15.1 to 0.15.2 (#20435) enterprise/providers/microsoft_entra: only check upn when set (#20441) core: bump selenium from 4.40.0 to 4.41.0 (#20436) website/docs: change permission name from 'Can view Admin interface' to 'Can access…' (#20412) website/integrations: add OIDC and update SAML instructions for Zammad (#20421) website/integrations: update wazuh acs url (#20401) web: Center footer links. (#20345) core: bump goauthentik.io/api/v3 to 3.2026.5.0-rc1-1771349690 (#20367) ci: bump tj-actions/changed-files from 47.0.3 to 47.0.4 (#20374) ci: bump helm/kind-action from 1.13.0 to 1.14.0 (#20375) core: bump library/golang from 1.25.5-trixie to 1.26.0-trixie in /lifecycle/container (#20381) ...
* main: (167 commits) enterprise: monkey patch pyjwt to accept mismatching key (#20402) enterprise/lifecycle: use datetime instead of date to track review cycles (#20283) root: run `npm i` with `npm@11.10.1` in all subdirectories (#20471) providers/oauth2: device code flow client id via auth header (#20457) core: bump goauthentik/fips-debian from `4419749` to `d6def0a` in /lifecycle/container (#20467) core: bump goauthentik/fips-python from `d973c46` to `bccefee` in /lifecycle/container (#20466) core, web: bump ajv from 6.12.6 to 6.14.0 in /packages/prettier-config (#20462) ci: bump and fix daily (#20461) website/integrations: fix Vaultwarden SSO_SCOPES syntax (#20459) stages/user_login: log correct user when session binding is broken (#20094) web/flow: generate a single API object for network transactions and use it for the lifetime of the FlowExecutor (#20030) web/flow: refactor flow executor so component selection is in an easy-to-maintain table (#19999) website/integrations: gatus: fix config block (#20446) core: bump msgraph-sdk from 1.54.0 to 1.55.0 (#20432) core: bump aws-cdk-lib from 2.238.0 to 2.239.0 (#20434) core: bump constructs from 10.5.0 to 10.5.1 (#20433) core: bump goauthentik/fips-python from `c272691` to `d973c46` in /lifecycle/container (#20437) core: bump goauthentik/fips-debian from `b0917af` to `4419749` in /lifecycle/container (#20438) web/admin/bugfix: Edit Stage not working. Invoking IdentificationStageForm not working (#20429) core: bump ruff from 0.15.1 to 0.15.2 (#20435) ...
|
|
…eForm not working (cherry-pick #20429 to version-2026.2) (#20512) * Cherry-pick #20429 to version-2026.2 (with conflicts) This cherry-pick has conflicts that need manual resolution. Original PR: #20429 Original commit: ab981de * revert miscellaneous changes These don't need to be in 2026.2 --------- Co-authored-by: Ken Sternberg <133134217+kensternberg-authentik@users.noreply.github.com> Co-authored-by: Simonyi Gergő <gergo@goauthentik.io>
What
StrictUnsafe: if the property is “wrapped” and untyped, treat it as an attribute, not a property.ak-bound-stages-listtarget attribute to be an attribute, not a property.Why
ModelFormuses both a converter and get/set accessors to manage the pk (primary key) of the object it is being invoked to edit: the first because Django primary keys can be either strings or numbers, and the latter because we have special transactional requirements when a primary key changes. Lit’s magic for handling this creates some weirdness around JavaScript prototyping (wrappedbecomes the only key on the object; all the other keys become delegated to a prototype object), sohasOwn()can’t be used; we just have to check forwrappedand!type.attributefield onModelForm.pk! Removing the.property marker both avoids this issue and makes visible exactly what item-id is being referenced.make web)