From 36ca26493181a54ee2fbf0bd488bb1a2152287bf Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sun, 15 Apr 2012 09:35:51 +0200 Subject: [PATCH] Remove superuser function. --- openslides/participant/forms.py | 6 +++--- .../static/images/icons/im-user.png | Bin 746 -> 0 bytes .../static/images/icons/meeting-chair.png | Bin 752 -> 0 bytes .../static/javascript/participant.js | 19 ------------------ .../participant/static/styles/participant.css | 17 ---------------- .../templates/participant/overview.html | 5 ----- openslides/participant/urls.py | 12 ----------- openslides/participant/views.py | 19 ------------------ 8 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 openslides/participant/static/images/icons/im-user.png delete mode 100644 openslides/participant/static/images/icons/meeting-chair.png diff --git a/openslides/participant/forms.py b/openslides/participant/forms.py index 13db3fc3a..409f8dd23 100644 --- a/openslides/participant/forms.py +++ b/openslides/participant/forms.py @@ -35,7 +35,7 @@ class UserNewForm(ModelForm, CssClassMixin): class Meta: model = User - exclude = ('username', 'password', 'is_staff', 'last_login', 'date_joined', 'user_permissions') + exclude = ('username', 'password', 'is_staff', 'is_superuser', 'last_login', 'date_joined', 'user_permissions') class UserEditForm(ModelForm, CssClassMixin): @@ -44,13 +44,13 @@ class UserEditForm(ModelForm, CssClassMixin): class Meta: model = User - exclude = ('password', 'is_staff', 'last_login', 'date_joined', 'user_permissions') + exclude = ('password', 'is_staff', 'is_superuser', 'last_login', 'date_joined', 'user_permissions') class UsernameForm(ModelForm, CssClassMixin): class Meta: model = User - exclude = ('first_name', 'last_name', 'email', 'is_active','is_superuser', 'groups', 'password', 'is_staff', 'last_login', 'date_joined', 'user_permissions') + exclude = ('first_name', 'last_name', 'email', 'is_active', 'is_superuser', 'groups', 'password', 'is_staff', 'last_login', 'date_joined', 'user_permissions') class ProfileForm(ModelForm, CssClassMixin): diff --git a/openslides/participant/static/images/icons/im-user.png b/openslides/participant/static/images/icons/im-user.png deleted file mode 100644 index 1d3adc250dbb7f79e1ffdcb8d480169f81b27310..0000000000000000000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B=NMs7*&kZXA3{~uQm-+cDVq;fsIj*+k zkz9z>Z0R@abWU&yP5Atk|BIft#%I0{pC__$zNoIO+VSk@)14I+6)Yme z(bJ5t&#!C_50BEdFtKN86CVmLOM503#>B&O#%9v0UB}uK+1#wWgzot8Fl?Tvy!)r; SIc1 - - - {% endif %} diff --git a/openslides/participant/urls.py b/openslides/participant/urls.py index f24f99b4d..3d1b39e5d 100644 --- a/openslides/participant/urls.py +++ b/openslides/participant/urls.py @@ -51,18 +51,6 @@ urlpatterns = patterns('participant.views', name='user_inactive', ), - url(r'^(?P\d+)/superuser/$', - 'user_set_superuser', - {'superuser': True}, - name='user_superuser', - ), - - url(r'^(?P\d+)/normaluser/$', - 'user_set_superuser', - {'superuser': False}, - name='user_normaluser', - ), - url(r'^import$', 'user_import', name='user_import', diff --git a/openslides/participant/views.py b/openslides/participant/views.py index d9323173a..e6bb42077 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -187,25 +187,6 @@ def user_delete(request, user_id): gen_confirm_form(request, _('Do you really want to delete %s?') % user, reverse('user_delete', args=[user_id])) return redirect(reverse('user_overview')) -@permission_required('participant.can_manage_participant') -@template('confirm.html') -def user_set_superuser(request, user_id, superuser=True): - try: - user = User.objects.get(pk=user_id) - user.is_superuser = superuser - user.save() - except User.DoesNotExist: - messages.error(request, _('Participant %d does not exist.') % int(user_id)) - - if request.is_ajax(): - if superuser: - link = reverse('user_normaluser', args=[user.id]) - else: - link = reverse('user_superuser', args=[user.id]) - return ajax_request({'superuser': superuser, - 'link': link}) - return redirect(reverse('user_overview')) - @permission_required('participant.can_manage_participant') @template('confirm.html') def user_set_active(request, user_id, active=True):