Create a TokenExpiresFieldType.

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

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.
Summary ID
Create a TokenExpiresFieldType.
cf297492119d79f73cee7a70e21f76fdd75b3311
Description From Last Updated

no newline at end of file Column: 69 Error code: W292

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

maubin
david
  1. Ship It!
  2. 
      
maubin
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.x (de885a1)
Loading...