mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-06 02:15:20 +02:00
Reser repo owner to organization when error occurs in repo create page, dashboard news feed page, create organization page
This commit is contained in:
parent
5e81383413
commit
9813161411
22 changed files with 350 additions and 269 deletions
|
@ -305,13 +305,11 @@ func TransferRepoAction(u, newUser *User, repo *Repository) (err error) {
|
|||
}
|
||||
|
||||
// GetFeeds returns action list of given user in given context.
|
||||
func GetFeeds(userid, offset int64, isProfile bool) ([]*Action, error) {
|
||||
func GetFeeds(uid, offset int64, isProfile bool) ([]*Action, error) {
|
||||
actions := make([]*Action, 0, 20)
|
||||
sess := x.Limit(20, int(offset)).Desc("id").Where("user_id=?", userid)
|
||||
sess := x.Limit(20, int(offset)).Desc("id").Where("user_id=?", uid)
|
||||
if isProfile {
|
||||
sess.Where("is_private=?", false).And("act_user_id=?", userid)
|
||||
} else {
|
||||
sess.And("act_user_id!=?", userid)
|
||||
sess.Where("is_private=?", false).And("act_user_id=?", uid)
|
||||
}
|
||||
err := sess.Find(&actions)
|
||||
return actions, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue