rewrote delete participant view as class based view
This commit is contained in:
parent
c029fe2f95
commit
90fddba63b
@ -14,7 +14,8 @@ from django.conf.urls.defaults import url, patterns
|
|||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
|
||||||
from openslides.participant.views import (
|
from openslides.participant.views import (
|
||||||
ParticipantsListPDF, ParticipantsPasswordsPDF, Overview, UserCreateView, UserUpdateView)
|
ParticipantsListPDF, ParticipantsPasswordsPDF, Overview, UserCreateView,
|
||||||
|
UserUpdateView, UserDeleteView)
|
||||||
|
|
||||||
urlpatterns = patterns('openslides.participant.views',
|
urlpatterns = patterns('openslides.participant.views',
|
||||||
url(r'^$',
|
url(r'^$',
|
||||||
@ -37,8 +38,8 @@ urlpatterns = patterns('openslides.participant.views',
|
|||||||
name='user_print',
|
name='user_print',
|
||||||
),
|
),
|
||||||
|
|
||||||
url(r'^(?P<user_id>\d+)/del/$',
|
url(r'^(?P<pk>\d+)/del/$',
|
||||||
'user_delete',
|
UserDeleteView.as_view(),
|
||||||
name='user_delete',
|
name='user_delete',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ from openslides.utils.utils import (
|
|||||||
template, permission_required, gen_confirm_form, ajax_request, decodedict,
|
template, permission_required, gen_confirm_form, ajax_request, decodedict,
|
||||||
encodedict, delete_default_permissions, html_strong)
|
encodedict, delete_default_permissions, html_strong)
|
||||||
from openslides.utils.views import (
|
from openslides.utils.views import (
|
||||||
FormView, PDFView, TemplateView, CreateView, UpdateView)
|
FormView, PDFView, TemplateView, CreateView, UpdateView, DeleteView)
|
||||||
|
|
||||||
from openslides.config.models import config
|
from openslides.config.models import config
|
||||||
|
|
||||||
@ -157,6 +157,9 @@ class UserCreateView(CreateView):
|
|||||||
|
|
||||||
|
|
||||||
class UserUpdateView(UpdateView):
|
class UserUpdateView(UpdateView):
|
||||||
|
"""
|
||||||
|
Update an existing participant.
|
||||||
|
"""
|
||||||
permission_required = 'participant.can_manage_participant'
|
permission_required = 'participant.can_manage_participant'
|
||||||
template_name = 'participant/edit.html'
|
template_name = 'participant/edit.html'
|
||||||
model = OpenSlidesUser
|
model = OpenSlidesUser
|
||||||
@ -166,6 +169,15 @@ class UserUpdateView(UpdateView):
|
|||||||
apply_url = 'participant_edit'
|
apply_url = 'participant_edit'
|
||||||
|
|
||||||
|
|
||||||
|
class UserDeleteView(DeleteView):
|
||||||
|
"""
|
||||||
|
Delete an participant.
|
||||||
|
"""
|
||||||
|
permission_required = 'participant.can_manage_participant'
|
||||||
|
model = OpenSlidesUser
|
||||||
|
url = 'user_overview'
|
||||||
|
|
||||||
|
|
||||||
@permission_required('participant.can_manage_participant')
|
@permission_required('participant.can_manage_participant')
|
||||||
@template('confirm.html')
|
@template('confirm.html')
|
||||||
def user_delete(request, user_id):
|
def user_delete(request, user_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user