Skip to content

Commit

Permalink
Warning fixes, update deps (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 authored Jul 5, 2024
1 parent b854569 commit 11b99ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jobs/payment-jobs/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pay-api/src/pay_api/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ def rollback():
@classmethod
def find_by_id(cls, identifier: int):
"""Return model by id."""
return db.session.get(cls, identifier)
if identifier:
return db.session.get(cls, identifier)
return None
2 changes: 1 addition & 1 deletion pay-api/src/pay_api/models/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ class Meta: # pylint: disable=too-few-public-methods
to_date = fields.Date(tzinfo=pytz.timezone(LEGISLATIVE_TIMEZONE))
is_overdue = fields.Boolean()
payment_methods = fields.List(fields.String())
amount_owing = fields.Float(missing=0)
amount_owing = fields.Float(load_default=0)
3 changes: 1 addition & 2 deletions pay-api/src/pay_api/services/payment_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ def __getattr__(self, name):
"""Dynamic way of getting the properties from the DAO, anything not in __init__."""
if hasattr(self._dao, name):
return getattr(self._dao, name)
current_app.logger.warning('Attribute %s not found.', name)
return None
raise AttributeError(f'Attribute {name} not found.')

def __setattr__(self, name, value):
"""Dynamic way of setting the properties from the DAO."""
Expand Down
10 changes: 5 additions & 5 deletions pay-queue/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 11b99ac

Please sign in to comment.