From 8363b06fc1e2e3bd39fc38f8c01f48842300557e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Thu, 14 Feb 2013 19:27:36 +0100 Subject: [PATCH] Move motion exceptions to its own file in the motion app. --- openslides/motion/exceptions.py | 23 +++++++++++++++++++++++ openslides/motion/models.py | 12 +----------- 2 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 openslides/motion/exceptions.py diff --git a/openslides/motion/exceptions.py b/openslides/motion/exceptions.py new file mode 100644 index 000000000..f0e482804 --- /dev/null +++ b/openslides/motion/exceptions.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + openslides.motion.exceptions + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Exceptions for the motion app. + + :copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS. + :license: GNU GPL, see LICENSE for more details. +""" + +from openslides.utils.exceptions import OpenSlidesError + + +class MotionError(OpenSlidesError): + """Exception raised when errors in the motion accure.""" + pass + + +class WorkflowError(OpenSlidesError): + """Exception raised when errors in a workflow or state accure.""" + pass diff --git a/openslides/motion/models.py b/openslides/motion/models.py index 9e8adc51e..d02c8c2ec 100644 --- a/openslides/motion/models.py +++ b/openslides/motion/models.py @@ -24,7 +24,6 @@ from django.utils.translation import ugettext_lazy, ugettext_noop, ugettext as _ from openslides.utils.utils import _propper_unicode from openslides.utils.person import PersonField -from openslides.utils.exceptions import OpenSlidesError from openslides.config.models import config from openslides.config.signals import default_config_value from openslides.poll.models import ( @@ -34,11 +33,7 @@ from openslides.projector.api import register_slidemodel from openslides.projector.models import SlideMixin from openslides.agenda.models import Item - -class MotionError(OpenSlidesError): - """Exception raised when errors in the motion accure.""" - pass - +from .exceptions import MotionError, WorkflowError class Motion(SlideMixin, models.Model): """The Motion Class. @@ -629,11 +624,6 @@ class MotionPoll(CountInvalid, CountVotesCast, BasePoll): CountVotesCast.append_pollform_fields(self, fields) -class WorkflowError(OpenSlidesError): - """Exception raised when errors in a workflow or state accure.""" - pass - - class State(models.Model): """Defines a state for a motion.