-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "force private" logic #31012
Fix "force private" logic #31012
Conversation
There is one more incorrect readonly checkbox, last line here:
|
|
{{else}} | ||
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}> | ||
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} disabled{{end}}> | ||
{{if and .Repository.IsPrivate $.ForcePrivate}}<input type="hidden" name="private" value="{{.Repository.IsPrivate}}">{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it fine to have two form fields with name=private
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disabled
means it won't be submitted, that's why it needs an extra one here.
When creating a repo, the "FORCE_PRIVATE" config option should be respected, `readonly` doesn't work for checkbox, so it should use `disabled` attribute.
* giteaofficial/main: Fix "force private" logic (go-gitea#31012) [skip ci] Updated licenses and gitignores Improve reverse proxy documents and clarify the AppURL guessing behavior (go-gitea#31003) Fix bug on avatar (go-gitea#31008) Clean up revive linter config, tweak golangci output (go-gitea#30980) Simplify mirror repository API logic (go-gitea#30963)
When creating a repo, the "FORCE_PRIVATE" config option should be respected,
readonly
doesn't work for checkbox, so it should usedisabled
attribute.