Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael committed Nov 5, 2021
1 parent ffe9716 commit e759697
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
37 changes: 37 additions & 0 deletions django_workflow_system/migrations/0010_auto_20211105_0940.py
Original file line number Diff line number Diff line change
@@ -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'),
),
]
10 changes: 9 additions & 1 deletion django_workflow_system/models/collections/engagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e759697

Please sign in to comment.