Skip to content

Commit

Permalink
Merge pull request #200 from T0jan/pricing_bug
Browse files Browse the repository at this point in the history
patch parameter check issue detection
  • Loading branch information
eeintech authored Jan 15, 2024
2 parents ec9b708 + 2642724 commit d1f9eb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kintree/database/inventree_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def create_parameter(part_id: int, template_name: int, value: str):
})
except Exception as e:
cprint(f'[TREE]\tError: Failed to update part parameter "{template_name}".', silent=settings.SILENT)
if "Invalid choice for parameter value" in e.args[0]['body']:
if "Could not convert" in e.args[0]['body'].__str__():
cprint(f'[TREE]\tError: Parameter value "{value}" is not allowed by server settings.', silent=settings.SILENT)
break
# cprint(part_parameters, silent=SILENT)
Expand All @@ -770,7 +770,7 @@ def create_parameter(part_id: int, template_name: int, value: str):
})
except Exception as e:
cprint(f'[TREE]\tError: Failed to create part parameter "{template_name}".', silent=settings.SILENT)
if "Invalid choice for parameter value" in e.args[0]['body']:
if "Could not convert" in e.args[0]['body'].__str__():
cprint(f'[TREE]\tError: Parameter value "{value}" is not allowed by server settings.', silent=settings.SILENT)

if parameter:
Expand Down

0 comments on commit d1f9eb3

Please sign in to comment.