Skip to content

Commit

Permalink
Fix return value.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Sep 28, 2023
1 parent ea241b6 commit c58f75a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions order/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def register_lazy_attr(
classdict[lazy_attr] = field

# add a property for the original attribute
def fget(self) -> float:
def fget(self):
value = getattr(self, lazy_attr)

# when the value is (already) materialized, just return it
Expand Down Expand Up @@ -154,12 +154,11 @@ def fget(self) -> float:
)

# set the value
value_ = materialized[adapter_model_.key]
setattr(self, lazy_attr_, value_)
setattr(self, lazy_attr_, materialized[adapter_model_.key])

# assign it to the return value for the requested attribute
if attr_ == attr:
value = value_
value = getattr(self, lazy_attr_)

# complain if the return value was not set
if value == no_value:
Expand Down

0 comments on commit c58f75a

Please sign in to comment.