summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorydelafollye <yohann.delafollye@gmail.com>2020-10-16 04:48:38 +0200
committerGitHub <noreply@github.com>2020-10-16 04:48:38 +0200
commitcb171dbd56e3889735115a04e4846f98ec364d65 (patch)
tree4a846ff618ea553b6fa9fc923d1086970bbd00ab /models
parentChange order of possible-owner organizations to alphabetical (#13160) (diff)
downloadforgejo-cb171dbd56e3889735115a04e4846f98ec364d65.tar.xz
forgejo-cb171dbd56e3889735115a04e4846f98ec364d65.zip
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
Diffstat (limited to 'models')
-rw-r--r--models/user.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 7248db5337..f019475298 100644
--- a/models/user.go
+++ b/models/user.go
@@ -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 {