Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Preload Last torrents instead of First on profile page to load them in DESC order. Should close #396 (#620)

Cette révision appartient à :
goonyaa 2017-05-19 02:47:21 +03:00 révisé par ewhal
Parent cf8043f3de
révision 5d22718abd

Voir le fichier

@ -281,7 +281,7 @@ func RetrieveOldUploadsByUsername(username string) ([]uint, error) {
// RetrieveUserForAdmin retrieves a user for an administrator.
func RetrieveUserForAdmin(id string) (model.User, int, error) {
var user model.User
if db.ORM.Preload("Torrents").First(&user, id).RecordNotFound() {
if db.ORM.Preload("Torrents").Last(&user, id).RecordNotFound() {
return user, http.StatusNotFound, errors.New("user not found")
}
var liked, likings []model.User