Commit 2400181a authored by Douwe Maan's avatar Douwe Maan

Merge branch 'fix-cannot-move-project-error' into 'master'

Fix "Cannot move project" error message from popping up after a successful transfer

The JavaScript click handlers were never being removed, leading to duplicate requests when attempting to transfer a project to another namespace. The first transfer would succeed but the subsequent ones would fail, leading to the error message saying, "Cannot move project".

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/0c9f61294291514e0c2a48c204b6a1aa/image.png)

I attempted to write a unit test for this, but it was taking me too long to get it right.

Closes #1448 and #1128

See merge request !548
parents 76aade28 6fb1e80a
...@@ -3,7 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -3,7 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased) v 7.11.0 (unreleased)
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky) - Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
- Ignore invalid lines in .gitmodules - Ignore invalid lines in .gitmodules
- - Fix "Cannot move project" error message from popping up after a successful transfer (Stan Hu)
- -
- -
- -
......
...@@ -173,6 +173,7 @@ $ -> ...@@ -173,6 +173,7 @@ $ ->
$(@).closest(".diff-file").find(".notes_holder").toggle() $(@).closest(".diff-file").find(".notes_holder").toggle()
e.preventDefault() e.preventDefault()
$(document).off "click", '.js-confirm-danger'
$(document).on "click", '.js-confirm-danger', (e) -> $(document).on "click", '.js-confirm-danger', (e) ->
e.preventDefault() e.preventDefault()
btn = $(e.target) btn = $(e.target)
......
...@@ -8,11 +8,13 @@ class @ConfirmDangerModal ...@@ -8,11 +8,13 @@ class @ConfirmDangerModal
submit = $('.js-confirm-danger-submit') submit = $('.js-confirm-danger-submit')
submit.disable() submit.disable()
$('.js-confirm-danger-input').off 'input'
$('.js-confirm-danger-input').on 'input', -> $('.js-confirm-danger-input').on 'input', ->
if rstrip($(@).val()) is project_path if rstrip($(@).val()) is project_path
submit.enable() submit.enable()
else else
submit.disable() submit.disable()
$('.js-confirm-danger-submit').off 'click'
$('.js-confirm-danger-submit').on 'click', => $('.js-confirm-danger-submit').on 'click', =>
@form.submit() @form.submit()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment