• 
      

    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.

    Commits

    Files