1
0
Fork 0
forked from forgejo/forgejo

Improve users management through the CLI (#6001) (#10492)

* Fix images in wiki edit preview (#11546)

Make sure wiki editor sets wiki to true so gitea renders it as a wiki page.

Also change the context data attr for edit form. This looks wrong but everywhere else in our code assumes the urlPrefix to be just the repo url when rendering and manually adds /wiki to the rendered url regardless.

Fixes #11540
This commit is contained in:
ydelafollye 2020-10-15 22:48:38 -04:00 committed by GitHub
parent 4fbe64572c
commit cb171dbd56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 121 additions and 24 deletions

View file

@ -235,6 +235,12 @@ func (u *User) GetEmail() string {
return u.Email
}
// GetAllUsers returns a slice of all users found in DB.
func GetAllUsers() ([]*User, error) {
users := make([]*User, 0)
return users, x.OrderBy("id").Find(&users)
}
// APIFormat converts a User to api.User
func (u *User) APIFormat() *api.User {
if u == nil {