Skip to content

Commit

Permalink
Fix invalid literal for int() with base 10: 'PL'
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed May 14, 2024
1 parent 5351b00 commit 8a917a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ralph/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ def save(self, *args, **kwargs):
# set default values if None provided
for field in ('country',):
val = getattr(self, field)
if isinstance(val, str):
val = Country.from_name(val.lower()).id
if val is None:
val = self._meta.get_field_by_name(field)[0].default
setattr(self, field, val)
Expand Down

0 comments on commit 8a917a7

Please sign in to comment.