diff --git a/django_workflow_system/migrations/0010_auto_20211105_0940.py b/django_workflow_system/migrations/0010_auto_20211105_0940.py new file mode 100644 index 0000000..3381106 --- /dev/null +++ b/django_workflow_system/migrations/0010_auto_20211105_0940.py @@ -0,0 +1,37 @@ +# Generated by Django 3.2.9 on 2021-11-05 14:40 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('django_workflow_system', '0009_update_user_input_types'), + ] + + operations = [ + migrations.AlterField( + model_name='workflowcollectionengagement', + name='finished', + field=models.DateTimeField(blank=True, help_text='When the user finished the engagement.', null=True), + ), + migrations.AlterField( + model_name='workflowcollectionengagement', + name='started', + field=models.DateTimeField(default=django.utils.timezone.now, help_text='When the user started the engagment.'), + ), + migrations.AlterField( + model_name='workflowcollectionengagement', + name='user', + field=models.ForeignKey(help_text='The user to whom the engagement belongs.', on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='workflowcollectionengagement', + name='workflow_collection', + field=models.ForeignKey(help_text='The collection which the engagement records data for.', on_delete=django.db.models.deletion.PROTECT, to='django_workflow_system.workflowcollection'), + ), + ] diff --git a/django_workflow_system/models/collections/engagement.py b/django_workflow_system/models/collections/engagement.py index 59a39d2..3e42423 100644 --- a/django_workflow_system/models/collections/engagement.py +++ b/django_workflow_system/models/collections/engagement.py @@ -119,7 +119,7 @@ def state(self) -> EngagementStateType: ) for step in all_collection_steps: - pprint(vars(step)) + pprint(vars(step), "\n") # Special case to prevent crash when collection has no steps. if not all_collection_steps: @@ -150,6 +150,9 @@ def state(self) -> EngagementStateType: .order_by("workflowcollectionmember__order") ) + for collection in all_collection_workflows: + pprint("Collection Member", vars(collection), "\n") + all_engagement_details: QuerySet[ WorkflowCollectionEngagementDetail ] = self.workflowcollectionengagementdetail_set.all() @@ -268,10 +271,15 @@ def state(self) -> EngagementStateType: next_step = next_step_in_workflow next_workflow = next_step_in_workflow.workflow + print("Using the next step in the same workflow.") + elif ( self.workflow_collection.category == "SURVEY" or self.workflow_collection.ordered ): + print( + "There is no next step in the current workflow. Need to see if there is a next step in the next workflow." + ) """ If there isn't another step in the workflow AND the collection is a survey or an ordered activity, we can use the first step of the next workflow in the diff --git a/setup.cfg b/setup.cfg index 587f20a..6ca3d38 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-workflow-system -version = 0.9.9 +version = 0.9.10 description = A highly customizable workflow system for Django. Create surveys, activities, etc. description-file = README.md long_description_content_type = text/markdown diff --git a/setup.py b/setup.py index ad3e2f3..dd5fb07 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def read(f): setup( name="django-workflow-system", - version="0.9.9", + version="0.9.10", description="A highly customizable workflow system for Django. Create surveys, activities, etc.", long_description=read("README.md"), long_description_content_type="text/markdown",