Skip to content

Commit

Permalink
added null check and handling for null elements in doc_groups list
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxwell-Lindsey committed Feb 27, 2024
1 parent 49f354d commit 5d1168a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ai_ta_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def appendDocumentToGroup():
doc_group = data['doc_group']

document_data = data.get('document', {})
document_data['doc_groups'] = document_data.get('doc_groups', [])
document_data['doc_groups'] = [group for group in document_data.get('doc_groups', []) if group is not None]

try:
document = MaterialDocument(**document_data)
Expand All @@ -766,7 +766,7 @@ def removeDocumentFromGroup():
doc_group = data['doc_group']

document_data = data.get('document', {})
document_data['doc_groups'] = document_data.get('doc_groups', [])
document_data['doc_groups'] = [group for group in document_data.get('doc_groups', []) if group is not None]

try:
document = MaterialDocument(**document_data)
Expand Down

0 comments on commit 5d1168a

Please sign in to comment.