Skip to content

Commit

Permalink
router may be unset
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Jun 23, 2023
1 parent 092b3bf commit 5cf83a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wq/db/rest/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ def __init__(self, router, model, **kwargs):
def slug_field(self):
if self._slug_field:
return self._slug_field
else:
elif self.router:
return self.router.get_lookup_for_model(self.model)
else:
return "pk"

def use_pk_only_optimization(self):
if self.slug_field == "pk":
Expand Down

0 comments on commit 5cf83a3

Please sign in to comment.