Commit 1e859cdd by Oláh István Gergely

dashboard: fix returning in removing user from group

parent 3dda2ca0
...@@ -48,15 +48,7 @@ function removeMember(data) { ...@@ -48,15 +48,7 @@ function removeMember(data) {
url: data['url'], url: data['url'],
headers: {"X-CSRFToken": getCookie('csrftoken')}, headers: {"X-CSRFToken": getCookie('csrftoken')},
success: function(re, textStatus, xhr) { success: function(re, textStatus, xhr) {
if(!data['redirect']) { $('#group-detail-pane').load(location.href+" #group-detail-panel");
selected = [];
addMessage(re['message'], 'success');
$('a[data-'+data['type']+'-pk="' + data['pk'] + '"]').closest('tr').fadeOut(function() {
$(this).remove();
});
} else {
window.location.replace('/dashboard');
}
}, },
error: function(xhr, textStatus, error) { error: function(xhr, textStatus, error) {
addMessage('Uh oh :(', 'danger') addMessage('Uh oh :(', 'danger')
......
...@@ -1022,7 +1022,8 @@ class GroupRemoveUserView(LoginRequiredMixin, DeleteView): ...@@ -1022,7 +1022,8 @@ class GroupRemoveUserView(LoginRequiredMixin, DeleteView):
if next: if next:
return next return next
else: else:
return reverse_lazy('dashboard.views.group-list') return reverse_lazy("dashboard.views.group-detail",
kwargs={'pk': self.get_object().pk})
def get(self, request, member_pk, *args, **kwargs): def get(self, request, member_pk, *args, **kwargs):
self.member_pk = member_pk self.member_pk = member_pk
...@@ -1045,7 +1046,6 @@ class GroupRemoveUserView(LoginRequiredMixin, DeleteView): ...@@ -1045,7 +1046,6 @@ class GroupRemoveUserView(LoginRequiredMixin, DeleteView):
self.remove_member(kwargs["member_pk"]) self.remove_member(kwargs["member_pk"])
success_url = self.get_success_url() success_url = self.get_success_url()
success_message = self.get_success_message() success_message = self.get_success_message()
if request.is_ajax(): if request.is_ajax():
return HttpResponse( return HttpResponse(
json.dumps({'message': success_message}), json.dumps({'message': success_message}),
......
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 sign in to comment