coldfront icon indicating copy to clipboard operation
coldfront copied to clipboard

AllocationAttribute clean method exception handling

Open claire-peters opened this issue 1 year ago • 0 comments

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.

claire-peters avatar Nov 22 '23 01:11 claire-peters