Skip to content

Commit

Permalink
Merge pull request #103 from crcresearch/develop
Browse files Browse the repository at this point in the history
Debugging a problem encountered by a client.
  • Loading branch information
Michael Dunn authored Aug 1, 2021
2 parents 1b60eb6 + 1c6dd8e commit 8f018c9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ def patch(self, request, engagement_id, id):
workflow_collection_engagement__user=request.user,
)

# If "users_responses" exists in the payload and is not a false-like value
# add a submittedTime attribute to it. TODO: This perhaps should be done on the front-end.
# We need to set a submitted time on the input
if "user_responses" in request.data.keys() and request.data["user_responses"]:
request.data["user_responses"][-1]["submittedTime"] = str(timezone.now())

Expand Down Expand Up @@ -352,12 +351,18 @@ def patch(self, request, engagement_id, id):

# Check if we are able to proceed to the next step
if data["user_responses"] and "inputs" in data["user_responses"][-1].keys():
checker = [
entry["is_valid"]
for entry in serializer.data["user_responses"][-1]["inputs"]
]
data["state"]["proceed"] = False if False in checker else True
try:
checker = [
entry["is_valid"]
for entry in serializer.data["user_responses"][-1]["inputs"]
]
data["state"]["proceed"] = False if False in checker else True
except KeyError as exception:
print("Exception Encountered: ", exception)
print("Inputs: ", serializer.data["user_responses"][-1]["inputs"])

data["state"]["proceed"] = False
else:
data["state"]["proceed"] = True
data["proceed"] = True

return Response(data=data, status=status.HTTP_200_OK)
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
version = 0.9.2
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",
version="0.9.2",
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 8f018c9

Please sign in to comment.