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