Create a TokenExpiresFieldType.

Review Request #12604 — Created Sept. 15, 2022 and submitted — Latest diff uploaded

Information

Djblets
release-3.x

Reviewers

While adding the UI for setting expiration dates on Review Board's API tokens,
we ran into a blocker for setting the expiration to a null value (i.e. giving
the token no expiration date). This is because our API request fields don't
support null values, they expect a value to be set for the given field.

Rather than tackling this concept of allowing null values for all request
fields right now (this should be done eventually though), this change simply
creates a specialized TokenExpiresFieldType which will allow null values as
well as date/time values that are supported by the DateTimeFieldType.

  • Created unit tests for the new field type and ran tests in
    djblets.webapi.tests.test_fields.py
  • Manually tested setting the expiration date to empty strings and
    null values through the API.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Create a TokenExpiresFieldType.
94cfa2b2dc804ed74c179a1b77069c9ca63114b2 Michelle Aubin
djblets/webapi/fields.py
djblets/webapi/tests/test_fields.py
Loading...