Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make barcodes strings rather than ints #109

Open
bufordrat opened this issue Mar 14, 2023 · 0 comments
Open

Make barcodes strings rather than ints #109

bufordrat opened this issue Mar 14, 2023 · 0 comments

Comments

@bufordrat
Copy link

bufordrat commented Mar 14, 2023

Make barcodes strings rather than ints

Currently, the dibs app type-casts item barcodes into ints when it extracts them from the URL route. For example, see line 389 of dibs/server.py:

...
@dibs.get('/edit/<barcode:int>', apply = VerifyStaffUser())
...

This leads to two runtime bugs. The first, which should apply across different use cases and institutions, is that any barcode with leading zeros gets the first few digits stripped, leading dibs to query the LSP for an ill-formed barcode and throw an error. The second problem, which is likely specific to UChicago, is that barcodes for our analyze series start with an A, and thus can't be recast to ints.

In a PR coming soon, we will propose treating barcodes as strings rather than ints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant