Changed comlex workflow automaticly set the identifier

This commit is contained in:
Oskar Hahn 2013-03-12 22:13:17 +01:00
parent d21185a449
commit 304887e8f3
2 changed files with 8 additions and 4 deletions

View File

@ -383,7 +383,7 @@ class Motion(SlideMixin, models.Model):
if type(state) is int:
state = State.objects.get(pk=state)
if state.set_identifier:
if not state.dont_set_identifier:
self.set_identifier()
self.state = state
@ -734,8 +734,11 @@ class State(models.Model):
dont_set_new_version_active = models.BooleanField(default=False)
"""If true, new versions are not automaticly set active."""
set_identifier = models.BooleanField(default=False)
"""If true, the motion get a identifier if the state change to this one."""
dont_set_identifier = models.BooleanField(default=False)
"""Decides if the motion gets an identifier.
If true, the motion does not get an identifier if the state change to
this one, else it does."""
def __unicode__(self):
"""Returns the name of the state."""

View File

@ -61,7 +61,8 @@ def create_builtin_workflows(sender, **kwargs):
state_2_1 = State.objects.create(name=ugettext_noop('published'),
workflow=workflow_2,
allow_support=True,
allow_submitter_edit=True)
allow_submitter_edit=True,
dont_set_identifier=True)
state_2_2 = State.objects.create(name=ugettext_noop('permitted'),
workflow=workflow_2,
action_word=ugettext_noop('Permit'),