diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-24 15:23:10 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-24 15:23:10 +0000 |
commit | e449426a4e7d15cdd582d4f136add52cbfb5e04e (patch) | |
tree | 45177341a5b6691fd32dac5460f763d64ab05671 | |
parent | add099b024cc4155a5be494fdb9ae339fd073a14 (diff) | |
parent | 19f478e00d1508728d0170ac60defed0535a0789 (diff) | |
download | gitlab-ce-e449426a4e7d15cdd582d4f136add52cbfb5e04e.tar.gz |
Merge branch 'fix-error-500-groups-with-avatar' into 'master'
Fix Error 500 in API when accessing a group that has an avatar
Closes #2340
See merge request !1189
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/models/group.rb | 1 | ||||
-rw-r--r-- | spec/requests/api/groups_spec.rb | 3 |
3 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 7ec1dabcf95..67ded53ad79 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.0.0 (unreleased) + - Fix Error 500 in API when accessing a group that has an avatar (Stan Hu) - Remove user OAuth tokens from the database and request new tokens each session (Stan Hu) - Only show recent push event if the branch still exists or a recent merge request has not been created (Stan Hu) - Remove satellites diff --git a/app/models/group.rb b/app/models/group.rb index 4ff610f8e9d..9cd146bb73b 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -17,6 +17,7 @@ require 'carrierwave/orm/activerecord' require 'file_size_validator' class Group < Namespace + include Gitlab::ConfigHelper include Referable has_many :group_members, dependent: :destroy, as: :source, class_name: 'GroupMember' diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 1d5b4f6f36b..13cced81875 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -7,7 +7,8 @@ describe API::API, api: true do let(:user2) { create(:user) } let(:user3) { create(:user) } let(:admin) { create(:admin) } - let!(:group1) { create(:group) } + let(:avatar_file_path) { File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') } + let!(:group1) { create(:group, avatar: File.open(avatar_file_path)) } let!(:group2) { create(:group) } before do |