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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-02 01:43:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-02 01:43:06 +0300
commitd40003afdea391c2d1396f3ab6c78705fa6d2a79 (patch)
tree9db27e723a5ce38b50106da5ef878453cbf4f990 /app/services
parenta986819a7bce2002018dfafed3900dc3f2e8fb81 (diff)
Add latest changes from gitlab-org/security/gitlab@13-3-stable-ee
Diffstat (limited to 'app/services')
-rw-r--r--app/services/applications/create_service.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/services/applications/create_service.rb b/app/services/applications/create_service.rb
index 500db1e172a..92500fbc254 100644
--- a/app/services/applications/create_service.rb
+++ b/app/services/applications/create_service.rb
@@ -11,7 +11,16 @@ module Applications
# EE would override and use `request` arg
def execute(request)
- Doorkeeper::Application.create(params)
+ @application = Doorkeeper::Application.new(params)
+
+ unless params[:scopes].present?
+ @application.errors.add(:base, _("Scopes can't be blank"))
+
+ return @application
+ end
+
+ @application.save
+ @application
end
end
end