Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/helpers/badges_helpers.rb')
-rw-r--r--lib/api/helpers/badges_helpers.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/helpers/badges_helpers.rb b/lib/api/helpers/badges_helpers.rb
index 46ce5b4e7b5..f402c603c87 100644
--- a/lib/api/helpers/badges_helpers.rb
+++ b/lib/api/helpers/badges_helpers.rb
@@ -6,7 +6,13 @@ module API
include ::API::Helpers::MembersHelpers
def find_badge(source)
- source.badges.find(params[:badge_id])
+ badge_id = params[:badge_id]
+
+ if source.is_a?(Project)
+ source.project_badges.find(badge_id)
+ else
+ source.badges.find(badge_id)
+ end
end
def present_badges(source, records, options = {})