Commit 3d5c9614 by Oláh István Gergely

dashboard: fix base remove user template - adding username

parent a69982ab
......@@ -1009,6 +1009,14 @@ class GroupRemoveUserView(LoginRequiredMixin, DeleteView):
slug_field = 'pk'
slug_url_kwarg = 'group_pk'
def get_context_data(self, **kwargs):
context = super(GroupRemoveUserView, self).get_context_data(**kwargs)
context['member'] = User.objects.get(pk=self.user_pk)
except User.DoesNotExist:
raise Http404()
return context
def get_success_url(self):
next = self.request.POST.get('next')
if next:
......@@ -1016,6 +1024,10 @@ class GroupRemoveUserView(LoginRequiredMixin, DeleteView):
return reverse_lazy('')
def get(self, request, user_pk, *args, **kwargs):
self.user_pk = user_pk
return super(GroupRemoveUserView, self).get(request, *args, **kwargs)
def get_template_names(self):
if self.request.is_ajax():
return ['dashboard/confirm/ajax-remove.html']
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