diff --git a/openslides/motion/forms.py b/openslides/motion/forms.py index 028328837..ef644aff1 100644 --- a/openslides/motion/forms.py +++ b/openslides/motion/forms.py @@ -49,8 +49,6 @@ class MotionSupporterMixin(forms.ModelForm): supporter = MultiplePersonFormField(required=False, label=_("Supporters")) - - class MotionTrivialChangesMixin(object): trivial_change = forms.BooleanField( required=False, label=_("Trivial change"), diff --git a/openslides/motion/models.py b/openslides/motion/models.py index 19afe043e..65c73d326 100644 --- a/openslides/motion/models.py +++ b/openslides/motion/models.py @@ -87,11 +87,13 @@ class Motion(SlideMixin, models.Model): Saves the motion. Create or update a motion_version object """ super(Motion, self).save(*args, **kwargs) - new_data = False - for attr in ['_title', '_text', '_reason']: - if hasattr(self, attr): + for attr in ['title', 'text', 'reason']: + if getattr(self, attr) != getattr(self.last_version, attr): new_data = True break + else: + new_data = False + need_new_version = True # TODO: Do we need a new version (look in config) if hasattr(self, '_version') or (new_data and need_new_version): version = self.new_version diff --git a/openslides/motion/views.py b/openslides/motion/views.py index c46697f20..23815b9d2 100644 --- a/openslides/motion/views.py +++ b/openslides/motion/views.py @@ -32,10 +32,6 @@ from .models import Motion, MotionSubmitter from .forms import (BaseMotionForm, MotionSubmitterMixin, MotionSupporterMixin, MotionTrivialChangesMixin) - -from django.views.generic.edit import ModelFormMixin - - class MotionListView(ListView): """ List all motion.