summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-01 22:43:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-01 22:43:06 +0000
commitd40003afdea391c2d1396f3ab6c78705fa6d2a79 (patch)
tree9db27e723a5ce38b50106da5ef878453cbf4f990 /app
parenta986819a7bce2002018dfafed3900dc3f2e8fb81 (diff)
downloadgitlab-ce-d40003afdea391c2d1396f3ab6c78705fa6d2a79.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-3-stable-ee
Diffstat (limited to 'app')
-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