summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-06 15:11:28 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-06 15:11:28 +0100
commit07539ab2b07bf2d1e652a34dcabc7cf907cd9906 (patch)
tree8ba023eb648d009467415fb910ad53c61a2b4b34 /app/controllers
parentb7d74401854198c7395d7d2c4ef76d9ef56f6d5f (diff)
parent348dff0a826c45f00f992e761423a22d2ac32bc3 (diff)
downloadgitlab-ce-pipeline-blocking-actions.tar.gz
Merge branch 'master' into pipeline-blocking-actionspipeline-blocking-actions
* master: (26 commits) Fix UserBasic Rename `/take` to `/take_ownership`, expose `owner` in `v3`. Update after review Fix values being called at Array instead of Hash Fix json response in branches controller Improve docs and specs related to pages artifacts Add MR fo changelog about removing pages artifacts Delete artifacts for pages unless expiry date is specified Lint doc Improved team selection Move foreign key to separate migration Fix import model attributes Update documentation and expose ID Introduce tests for pipeline triggers Fix trigger model Update db/schema Make triggers to be user aware Make Pipeline Triggers to be user aware Update triggers API Remove remnants of git annex ... Conflicts: db/schema.rb
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/profiles/keys_controller.rb5
-rw-r--r--app/controllers/profiles_controller.rb11
-rw-r--r--app/controllers/projects/branches_controller.rb2
-rw-r--r--app/controllers/projects/notes_controller.rb7
4 files changed, 14 insertions, 11 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb
index c8663a3c38e..e4452f46056 100644
--- a/app/controllers/profiles/keys_controller.rb
+++ b/app/controllers/profiles/keys_controller.rb
@@ -10,11 +10,6 @@ class Profiles::KeysController < Profiles::ApplicationController
@key = current_user.keys.find(params[:id])
end
- # Back-compat: We need to support this URL since git-annex webapp points to it
- def new
- redirect_to profile_keys_path
- end
-
def create
@key = current_user.keys.new(key_params)
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index f0c71725ea8..987b95e89b9 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -47,11 +47,14 @@ class ProfilesController < Profiles::ApplicationController
end
def update_username
- @user.update_attributes(username: user_params[:username])
-
- respond_to do |format|
- format.js
+ if @user.update_attributes(username: user_params[:username])
+ options = { notice: "Username successfully changed" }
+ else
+ message = @user.errors.full_messages.uniq.join('. ')
+ options = { alert: "Username change failed - #{message}" }
end
+
+ redirect_back_or_default(default: { action: 'show' }, options: options)
end
private
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index a01c0caa959..c40f9b7f75f 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -20,7 +20,7 @@ class Projects::BranchesController < Projects::ApplicationController
respond_to do |format|
format.html
format.json do
- render json: @repository.branch_names
+ render json: @branches.map(&:name)
end
end
end
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb
index 5cf3a7f593b..d00177e7612 100644
--- a/app/controllers/projects/notes_controller.rb
+++ b/app/controllers/projects/notes_controller.rb
@@ -211,6 +211,11 @@ class Projects::NotesController < Projects::ApplicationController
end
def find_current_user_notes
- @notes = NotesFinder.new(project, current_user, params).execute.inc_author
+ @notes = NotesFinder.new(project, current_user, params.merge(last_fetched_at: last_fetched_at))
+ .execute.inc_author
+ end
+
+ def last_fetched_at
+ request.headers['X-Last-Fetched-At']
end
end