Skip to content

500 internal server error when renaming an organisation as reserved name  #17876

Closed
@cobber

Description

@cobber

Gitea Version

1.15.3

Git Version

No response

Operating System

No response

How are you running Gitea?

standalone binary installation gitea-1.15.3-linux-arm-6 image installed under a dedicated "gitea" user

Database

SQLite

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

When I tried to rename one of my organisations to "admin" (for my git repo's with administrative scripts etc) I got a nondescript "500" error (without "internal server error" or any other information).

Being my own gitea admin, I was able to find the log entry:
2021/12/01 21:04:40 ...s/web/org/setting.go:72:SettingsPost() [E] ChangeUserName: name is reserved [name: admin]

It would be much more user friendly if at least this error message was displayed in the UI.

As far as I can tell this is being triggered via CreateOrgnization() when it gets an error from user_model.IsUsableUsername()

Also, the list of reserved names in models/user/user.go (reservedUsernames var) would be useful information to help the user understand what went wrong.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions