Skip to content

Commit 869d35e

Browse files
committed
Handle corner case when the entity-mapping doesn't return any entity but also there are no errors
1 parent 653f9e3 commit 869d35e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ravenpackapi/models/mapping.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def __init__(self, data):
1919
self.candidates = [
2020
RPMappingCandidate(candidate) for candidate in data.get("rp_entities", [])
2121
]
22+
if not self.candidates and not self.errors:
23+
self.errors = [self.request]
2224

2325
if not self.errors:
2426
# let's put the best candidate data on the obj for convenience

0 commit comments

Comments
 (0)