Merge pull request #80 from ostcar/master

pep8, django1.5 and smal fix
This commit is contained in:
Oskar Hahn 2013-01-05 06:33:27 -08:00
commit ece772540f
11 changed files with 17 additions and 11 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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):
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.'))