diff options
author | Sean McGivern <sean@gitlab.com> | 2017-02-01 16:38:52 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-02-02 10:23:50 +0000 |
commit | f799585c41d801bc657f992adf3d4b201af927d2 (patch) | |
tree | 024671600d97ba514bd06f896b4f508f4e790ace /app/models/snippet.rb | |
parent | 659cceb0e8694b58a8b665de3f338245244ef114 (diff) | |
download | gitlab-ce-f799585c41d801bc657f992adf3d4b201af927d2.tar.gz |
Keep snippet visibility on error
When a snippet is submitted, but there's an error, we didn't keep the
visibility level. As the default is private, this means that submitting
a public snippet that failed would then fall back to being a private
snippet.
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 771a7350556..960f1521be9 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -17,7 +17,7 @@ class Snippet < ActiveRecord::Base default_content_html_invalidator || file_name_changed? end - default_value_for :visibility_level, Snippet::PRIVATE + default_value_for(:visibility_level) { current_application_settings.default_snippet_visibility } belongs_to :author, class_name: 'User' belongs_to :project |