coldfront
coldfront copied to clipboard
AllocationAttribute clean method exception handling
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.