Merge pull request #607 from normanjaeckel/Rename_State_Attribute
Rename the state flag dont_set_new_version_active to leave_old_version_a...
This commit is contained in:
commit
7bdb1ee10c
2
fabfile.py
vendored
2
fabfile.py
vendored
@ -54,7 +54,7 @@ def pep8():
|
|||||||
|
|
||||||
def prepare_commit():
|
def prepare_commit():
|
||||||
"""
|
"""
|
||||||
Does everything before a commit should be done.
|
Does everything that should be done before a commit.
|
||||||
|
|
||||||
At the moment it is running the tests and check for PEP 8 errors.
|
At the moment it is running the tests and check for PEP 8 errors.
|
||||||
"""
|
"""
|
||||||
|
@ -180,7 +180,7 @@ class Motion(SlideMixin, models.Model):
|
|||||||
|
|
||||||
# Set the active version of this motion. This has to be done after the
|
# Set the active version of this motion. This has to be done after the
|
||||||
# version is saved to the database
|
# version is saved to the database
|
||||||
if not self.state.dont_set_new_version_active or self.active_version is None:
|
if self.active_version is None or not self.state.leave_old_version_active:
|
||||||
self.active_version = version
|
self.active_version = version
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
@ -803,7 +803,7 @@ class State(models.Model):
|
|||||||
MotionDisableVersioningMixin.
|
MotionDisableVersioningMixin.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
dont_set_new_version_active = models.BooleanField(default=False)
|
leave_old_version_active = models.BooleanField(default=False)
|
||||||
"""If true, new versions are not automaticly set active."""
|
"""If true, new versions are not automaticly set active."""
|
||||||
|
|
||||||
dont_set_identifier = models.BooleanField(default=False)
|
dont_set_identifier = models.BooleanField(default=False)
|
||||||
|
@ -160,7 +160,7 @@ def create_builtin_workflows(sender, **kwargs):
|
|||||||
allow_create_poll=True,
|
allow_create_poll=True,
|
||||||
allow_submitter_edit=True,
|
allow_submitter_edit=True,
|
||||||
versioning=True,
|
versioning=True,
|
||||||
dont_set_new_version_active=True)
|
leave_old_version_active=True)
|
||||||
state_2_3 = State.objects.create(name=ugettext_noop('accepted'),
|
state_2_3 = State.objects.create(name=ugettext_noop('accepted'),
|
||||||
workflow=workflow_2,
|
workflow=workflow_2,
|
||||||
action_word=ugettext_noop('Accept'),
|
action_word=ugettext_noop('Accept'),
|
||||||
|
@ -147,7 +147,7 @@ class ModelTest(TestCase):
|
|||||||
motion.text = 'bar'
|
motion.text = 'bar'
|
||||||
first_version = motion.version
|
first_version = motion.version
|
||||||
my_state = State.objects.create(name='automatic_versioning', workflow=self.workflow,
|
my_state = State.objects.create(name='automatic_versioning', workflow=self.workflow,
|
||||||
versioning=True, dont_set_new_version_active=True)
|
versioning=True, leave_old_version_active=True)
|
||||||
motion.state = my_state
|
motion.state = my_state
|
||||||
motion.save()
|
motion.save()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user