From 839589fde30cff9ecf963dab775bfd9b9b2fe17b Mon Sep 17 00:00:00 2001 From: Fabian Schneider Date: Sun, 11 Mar 2018 20:56:07 +0100 Subject: Change avatar error message to include allowed file formats --- app/models/concerns/avatarable.rb | 2 +- app/models/group.rb | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'app') diff --git a/app/models/concerns/avatarable.rb b/app/models/concerns/avatarable.rb index d35e37935fb..318df11727e 100644 --- a/app/models/concerns/avatarable.rb +++ b/app/models/concerns/avatarable.rb @@ -21,7 +21,7 @@ module Avatarable def avatar_type unless self.avatar.image? - self.errors.add :avatar, "only images allowed" + errors.add :avatar, "file format is not supported. Please try one of the following supported formats: #{AvatarUploader::IMAGE_EXT.join(', ')}" end end diff --git a/app/models/group.rb b/app/models/group.rb index 8d183006c65..8e391412b52 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -189,12 +189,6 @@ class Group < Namespace owners.include?(user) && owners.size == 1 end - def avatar_type - unless self.avatar.image? - self.errors.add :avatar, "only images allowed" - end - end - def post_create_hook Gitlab::AppLogger.info("Group \"#{name}\" was created") -- cgit v1.2.3