Fix bricklink and rebrickable links trying to cast lower() on an int

This commit is contained in:
Gregoo 2025-01-17 15:08:16 +01:00
parent 50ebc3877c
commit e2617daa40

View File

@ -193,7 +193,7 @@ class BrickPart(BrickRecord):
if current_app.config['BRICKLINK_LINKS'].value: if current_app.config['BRICKLINK_LINKS'].value:
try: try:
return current_app.config['BRICKLINK_LINK_PART_PATTERN'].value.format( # noqa: E501 return current_app.config['BRICKLINK_LINK_PART_PATTERN'].value.format( # noqa: E501
number=self.fields.part_num.lower(), number=self.fields.part_num,
) )
except Exception: except Exception:
pass pass
@ -253,7 +253,7 @@ class BrickPart(BrickRecord):
if current_app.config['REBRICKABLE_LINKS'].value: if current_app.config['REBRICKABLE_LINKS'].value:
try: try:
return current_app.config['REBRICKABLE_LINK_PART_PATTERN'].value.format( # noqa: E501 return current_app.config['REBRICKABLE_LINK_PART_PATTERN'].value.format( # noqa: E501
number=self.fields.part_num.lower(), number=self.fields.part_num,
color=self.fields.color_id, color=self.fields.color_id,
) )
except Exception: except Exception: