diff --git a/openslides/agenda/urls.py b/openslides/agenda/urls.py index 6022bff4d..392adbedf 100644 --- a/openslides/agenda/urls.py +++ b/openslides/agenda/urls.py @@ -10,7 +10,7 @@ :license: GNU GPL, see LICENSE for more details. """ -from django.conf.urls.defaults import url, patterns +from django.conf.urls import url, patterns from openslides.agenda.views import (Overview, View, SetClosed, ItemUpdate, ItemCreate, ItemDelete, AgendaPDF) diff --git a/openslides/assignment/urls.py b/openslides/assignment/urls.py index 5540b8a06..42e55b638 100644 --- a/openslides/assignment/urls.py +++ b/openslides/assignment/urls.py @@ -10,7 +10,7 @@ :license: GNU GPL, see LICENSE for more details. """ -from django.conf.urls.defaults import url, patterns +from django.conf.urls import url, patterns from openslides.assignment.views import (ViewPoll, AssignmentPDF, AssignmentPollPDF, AssignmentPollDelete, CreateAgendaItem) diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index f5e244732..6f95b44e0 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -318,7 +318,7 @@ class AssignmentPollDelete(DeleteView): return reverse('assignment_view', args=[self.assignment.id]) def get_success_message(self): - return _('Ballot was successfully deleted.') % self.object + return _('Ballot was successfully deleted.') % self.object class AssignmentPDF(PDFView): diff --git a/openslides/config/urls.py b/openslides/config/urls.py index 14659f5a8..84c1e93e9 100644 --- a/openslides/config/urls.py +++ b/openslides/config/urls.py @@ -11,7 +11,7 @@ """ from django.conf import settings -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url from django.utils.importlib import import_module from openslides.config.views import GeneralConfig, VersionConfig diff --git a/openslides/motion/urls.py b/openslides/motion/urls.py index 177a5b04f..aff36a491 100644 --- a/openslides/motion/urls.py +++ b/openslides/motion/urls.py @@ -10,7 +10,7 @@ :license: GNU GPL, see LICENSE for more details. """ -from django.conf.urls.defaults import url, patterns +from django.conf.urls import url, patterns from openslides.motion.views import (MotionDelete, ViewPoll, MotionPDF, MotionPollPDF, CreateAgendaItem, SupportView) diff --git a/openslides/participant/urls.py b/openslides/participant/urls.py index 569f8b85f..8fa6b9ca9 100644 --- a/openslides/participant/urls.py +++ b/openslides/participant/urls.py @@ -10,7 +10,7 @@ :license: GNU GPL, see LICENSE for more details. """ -from django.conf.urls.defaults import url, patterns +from django.conf.urls import url, patterns from openslides.participant.views import ( UserOverview, UserCreateView, UserDetailView, UserUpdateView, diff --git a/openslides/participant/views.py b/openslides/participant/views.py index bae5f0a69..ded8a55c7 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -471,7 +471,7 @@ def login(request): extra_content = {} try: admin = User.objects.get(pk=1) - if admin.check_password(admin.default_password): + if admin.check_password(admin.default_password): extra_content['first_time_message'] = _( "Installation was successfully! Use %(user)s " "(password: %(password)s) for first login.
" diff --git a/openslides/projector/urls.py b/openslides/projector/urls.py index 9c1433ec4..e5a8d49c6 100644 --- a/openslides/projector/urls.py +++ b/openslides/projector/urls.py @@ -10,7 +10,7 @@ :license: GNU GPL, see LICENSE for more details. """ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url from openslides.projector.views import (DashboardView, ActivateView, CustomSlideCreateView, CustomSlideUpdateView, CustomSlideDeleteView, diff --git a/openslides/urls.py b/openslides/urls.py index 5edb948d0..800ef85e6 100644 --- a/openslides/urls.py +++ b/openslides/urls.py @@ -11,7 +11,7 @@ """ from django.conf import settings -from django.conf.urls.defaults import patterns, url, include +from django.conf.urls import patterns, url, include from django.utils.importlib import import_module from openslides.utils.views import RedirectView diff --git a/openslides/utils/template.py b/openslides/utils/template.py index 5ed5eb778..b0ded80ad 100644 --- a/openslides/utils/template.py +++ b/openslides/utils/template.py @@ -15,7 +15,7 @@ from django.template.loader_tags import BlockNode, ExtendsNode class Tab(object): - def __init__(self, title='', url='', permission='', selected=False): + def __init__(self, title='', url='', permission=True, selected=False): self.selected = False self.title = title self.permission = permission diff --git a/openslides/utils/views.py b/openslides/utils/views.py index fbc742bf4..603786370 100644 --- a/openslides/utils/views.py +++ b/openslides/utils/views.py @@ -241,6 +241,8 @@ class UpdateView(PermissionMixin, _UpdateView): class CreateView(PermissionMixin, _CreateView): + apply_url = None + def get_success_url(self): messages.success(self.request, self.get_success_message()) if 'apply' in self.request.POST: @@ -254,7 +256,11 @@ class CreateView(PermissionMixin, _CreateView): return context def get_apply_url(self): - return self.apply_url + if self.apply_url: + return self.apply_url + else: + raise ImproperlyConfigured( + "No URL to redirect to. Provide a apply_url.") def form_invalid(self, form): messages.error(self.request, _('Please check the form for errors.'))