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

AllocationAttribute clean method exception handling #588

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

claire-peters
Copy link
Contributor

@claire-peters claire-peters commented Nov 22, 2023

The current use of literal_eval in coldfront.core.allocation.models.AllocationAttribute.clean causes the entry of a value with nonnumeric characters (e.g., "1000TB", "150%") for an AllocationAttribute with a numeric AllocationAttributeType to produce an EOF error. The code changes in this PR consist of the addition of smoother exception handling for such cases and unit tests for the AllocationAttribute model.

I also deleted a few imports in the Allocation model module that weren't in use, and my code editor automatically removed trailing whitespace where present. Can remove those changes if they present problems.

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

Successfully merging this pull request may close these issues.

1 participant