Skip to content

Commit

Permalink
Use more pythonic logic
Browse files Browse the repository at this point in the history
  • Loading branch information
juho-kettunen-nc committed Nov 21, 2024
1 parent 017c73a commit 6d0932c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion leasing/serializers/rent.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def validate_override_receivable_type_value(
# rent_data before later validations also during the update flow.
# Try get ID from the rent instance, which is present if an existing
# rent is being updated.
rent_id = self.instance.id if self.instance else None
rent_id = getattr(self.instance, "id", None)

if rent_id is not None:
self.full_validate_override_receivable_type(
Expand Down

0 comments on commit 6d0932c

Please sign in to comment.