Skip to content

Commit

Permalink
Apply requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed Feb 28, 2025
1 parent 4d8e1fa commit 8d6740e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kobo/apps/openrosa/apps/logger/models/xform.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ def asset(self):
"""
Asset = apps.get_model('kpi', 'Asset') # noqa
if not hasattr(self, '_cache_asset'):
# We only need to load the PK because XMLFormWithDisclaimer
# uses an Asset object only to narrow down a query with a filter,
# thus uses only asset PK
# We only need to load some fields when fetching the related Asset object
# with XMLFormWithDisclaimer
try:
asset = Asset.all_objects.only(
'pk', 'name', 'uid', 'owner_id'
Expand All @@ -133,7 +132,7 @@ def asset(self):
try:
asset = Asset.all_objects.only(
'pk', 'name', 'uid', 'owner_id'
).get(_deployment_data__formid=self.pk)
).get(_deployment_data__backend_response__formid=self.pk)
except Asset.DoesNotExist:
# An `Asset` object needs to be returned to avoid 500 while
# Enketo is fetching for project XML (e.g: /formList, /manifest)
Expand Down

0 comments on commit 8d6740e

Please sign in to comment.