Closed adeng27 closed 1 month ago
@adeng27 Reminder to add a check mark or something within the "Validate" button.
This could be an issue with my box, but perhaps you can recreate it:
In app-shell
, the validation function gives:
>>> from coldfront.core.billing.utils.validation import is_billing_id_valid
>>> is_billing_id_valid("123456-789")
False
>>> is_billing_id_valid("123456-788")
True
The UI gives a response that is inconsistent with the function above (I'd expect 788 to be valid):
=====
The CLI gives the below. This is referring to the fact that there's no corresponding BillingActivity
object. BillingActivity
objects are only created when we want to save a particular ID to associate it with a project or user, but there are many PIDs that exist that are not saved that we might want to check the validity of.
[root@ec3c26d1175b coldfront]# python manage.py billing_ids validate 123456-788
CommandError: Billing ID 123456-788 does not exist.
[root@ec3c26d1175b coldfront]# python manage.py billing_ids validate 123456-789
CommandError: Billing ID 123456-789 does not exist.
Branched off of docker_rocky8_python10 from @matthew-li.
The following was added:
billing_ids
command namedvalidate
that takes a space-separated list of billing IDs as input and prints out "Valid" or "Invalid" for each of those IDs./billing/validate/
that takes a list of newline-separated billing IDs as input and displays a message which shows whether each billing ID was "Valid," "Invalid," or "Malformed."Testing
/billing/validate
or click theValidate
button on/billing/usages/
coldfront.core.billing.tests.test_commands.test_billing_ids
.