@@ -14,6 +14,7 @@ import (
14
14
"errors"
15
15
"fmt"
16
16
"image"
17
+
17
18
// Needed for jpeg support
18
19
_ "image/jpeg"
19
20
"image/png"
@@ -377,12 +378,8 @@ func (u *User) GetFollowers(page int) ([]*User, error) {
377
378
users := make ([]* User , 0 , ItemsPerPage )
378
379
sess := x .
379
380
Limit (ItemsPerPage , (page - 1 )* ItemsPerPage ).
380
- Where ("follow.follow_id=?" , u .ID )
381
- if setting .UsePostgreSQL {
382
- sess = sess .Join ("LEFT" , "follow" , "`user`.id=follow.user_id" )
383
- } else {
384
- sess = sess .Join ("LEFT" , "follow" , "`user`.id=follow.user_id" )
385
- }
381
+ Where ("follow.follow_id=?" , u .ID ).
382
+ Join ("LEFT" , "follow" , "`user`.id=follow.user_id" )
386
383
return users , sess .Find (& users )
387
384
}
388
385
@@ -396,12 +393,8 @@ func (u *User) GetFollowing(page int) ([]*User, error) {
396
393
users := make ([]* User , 0 , ItemsPerPage )
397
394
sess := x .
398
395
Limit (ItemsPerPage , (page - 1 )* ItemsPerPage ).
399
- Where ("follow.user_id=?" , u .ID )
400
- if setting .UsePostgreSQL {
401
- sess = sess .Join ("LEFT" , "follow" , "`user`.id=follow.follow_id" )
402
- } else {
403
- sess = sess .Join ("LEFT" , "follow" , "`user`.id=follow.follow_id" )
404
- }
396
+ Where ("follow.user_id=?" , u .ID ).
397
+ Join ("LEFT" , "follow" , "`user`.id=follow.follow_id" )
405
398
return users , sess .Find (& users )
406
399
}
407
400
0 commit comments