-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix broken following organization #29005
Changes from all commits
2854ddf
1a17ca7
f06f458
a86df06
56a477f
5619035
1712b3a
807859f
d811b58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ import ( | |
|
||
const ( | ||
tplProfileBigAvatar base.TplName = "shared/user/profile_big_avatar" | ||
tplFollowUnfollow base.TplName = "shared/user/follow_unfollow" | ||
) | ||
|
||
// OwnerProfile render profile page for a user or a organization (aka, repo owner) | ||
|
@@ -318,6 +319,15 @@ func Action(ctx *context.Context) { | |
return | ||
} | ||
|
||
shared_user.PrepareContextForProfileBigAvatar(ctx) | ||
ctx.HTML(http.StatusOK, tplProfileBigAvatar) | ||
if ctx.ContextUser.IsIndividual() { | ||
shared_user.PrepareContextForProfileBigAvatar(ctx) | ||
ctx.HTML(http.StatusOK, tplProfileBigAvatar) | ||
return | ||
} else if ctx.ContextUser.IsOrganization() { | ||
ctx.Data["IsFollowing"] = ctx.Doer != nil && user_model.IsFollowing(ctx, ctx.Doer.ID, ctx.ContextUser.ID) | ||
ctx.HTML(http.StatusOK, tplFollowUnfollow) | ||
return | ||
} | ||
log.Error("Failed to apply action %q: unsupport context user type: %s", ctx.FormString("action"), ctx.ContextUser.Type) | ||
ctx.Error(http.StatusBadRequest, fmt.Sprintf("Action %q failed", ctx.FormString("action"))) | ||
Comment on lines
+326
to
+332
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why doesn't the same action apply as for users? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. user profile has the count of followers, that should also be refreshed. But org home page doesn’t. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, unfortunately. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also confused me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can take a stab at this after this PR is merged |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.ContextUser.Type
is not a%s
.