diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-01 22:43:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-01 22:43:06 +0000 |
commit | d40003afdea391c2d1396f3ab6c78705fa6d2a79 (patch) | |
tree | 9db27e723a5ce38b50106da5ef878453cbf4f990 /app | |
parent | a986819a7bce2002018dfafed3900dc3f2e8fb81 (diff) | |
download | gitlab-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.rb | 11 |
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 |