Skip to content

Commit

Permalink
Handle (by skipping) a fields statement that is a dictionary instead …
Browse files Browse the repository at this point in the history
…of a list
  • Loading branch information
nonprofittechy committed May 23, 2024
1 parent f512d78 commit 666fb71
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions docassemble/ALDashboard/data/questions/review_screen_generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ metadata:
mandatory: True
code: |
yaml_file
debug_step_1
results
---
question: |
Expand Down Expand Up @@ -50,14 +51,14 @@ code: |
generic_question_blocks = []
sections_temp = []
for doc in yaml_parsed:
if doc:
if doc and any(key in doc for key in ["fields", "question", "objects", "sections", "metadata"]):
question = {"question": doc.get('question',"").strip() }
generic_object = doc.get("generic object")
if generic_object:
generic_question_blocks.append(doc)
continue
fields_temp = []
if 'fields' in doc:
if 'fields' in doc and isinstance(doc["fields"], list):
for field in doc["fields"]:
if field and "code" in field:
try:
Expand Down Expand Up @@ -134,6 +135,36 @@ code: |
del questions_temp
del sections_temp
---
continue button field: debug_step_1
question: |
Debug Step 1
subquestion: |
### Objects
```
${ repr(objects) }
```
### Questions
```
${ repr(questions) }
```
### Sections
```
${ repr(section_events) }
```
### Attributes List
```
${ repr(attributes_list) }
```
### Generic Question Blocks
```
${ repr(generic_question_blocks) }
```
---
code: |
REVIEW_EVENT_NAME = "review_form"
review_fields_temp = []
Expand Down

0 comments on commit 666fb71

Please sign in to comment.