mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
FIX: Various invite system fixes (#13003)
* FIX: Ensure the same email cannot be invited twice When creating a new invite with a duplicated email, the old invite will be updated and returned. When updating an invite with a duplicated email address, an error will be returned. * FIX: not Ember helper does not exist * FIX: Sync can_invite_to_forum? and can_invite_to? The two methods should perform the same basic set of checks, such as check must_approve_users site setting. Ideally, one of the methods would call the other one or be merged and that will happen in the future. * FIX: Show invite to group if user is group owner
This commit is contained in:
@ -65,7 +65,12 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:can_review,
|
||||
|
||||
def groups
|
||||
object.visible_groups.pluck(:id, :name).map { |id, name| { id: id, name: name } }
|
||||
owned_group_ids = GroupUser.where(user_id: id, owner: true).pluck(:group_id).to_set
|
||||
object.visible_groups.pluck(:id, :name).map do |id, name|
|
||||
group = { id: id, name: name }
|
||||
group[:owner] = true if owned_group_ids.include?(id)
|
||||
group
|
||||
end
|
||||
end
|
||||
|
||||
def link_posting_access
|
||||
|
Reference in New Issue
Block a user