Skip to content

Commit

Permalink
Fix grouping with no domain_id
Browse files Browse the repository at this point in the history
- this can happen if the db was altered (when testing)
  • Loading branch information
tudoramariei committed Dec 11, 2024
1 parent a956a79 commit b3b0452
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/hub/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def group_queryset_by_domain(

for element in queryset:
element_domain_pk: Domain = getattr(element, domain_variable_name)

if not element_domain_pk:
logger.error(f"Element {element} does not have a domain.")
continue

if element_domain_pk not in queryset_by_domain_dict:
queryset_by_domain_dict[element_domain_pk] = []

Expand Down

0 comments on commit b3b0452

Please sign in to comment.