Skip to content

Holding the values in form when the post request is failed with error #22833

Open
@yp05327

Description

@yp05327

Description

At first, I found that some vaules in the form were missing or changed to default values automaticly, when creating an org or a repo with invalid name.
e.g.
image

Visibility in this page is required so users will be aware of the change.
But if there are some no required params with this bug, user may post wrong data with no awareness of these changes.

Then I found func AssignForm in modules/web/middleware/binding.go which is used to assign form values back to the template data.
It seems we need to define same variable names between form data and template data?

e.g.
Visibility in this page is defined as DefaultOrgVisibilityMode in template data, but visibility in form data.

Gitea Version

87261f3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

build

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions