Support validating cache backends on Django 1.6 and 1.11.

Review Request #10506 — Created April 3, 2019 and submitted

Information

Review Board
release-4.0.x

Reviewers

This adds support for validating the cache backend in the General
Settings page on Django 1.11. We no longer have access to get_cache(),
which was present on Django 1.6, so we now duplicate the functionality
by importing the backend manually and then constructing an instance of
the backend.

In order to test this on Django 1.11, a change needed to be made to the
cache field display logic for the form. Modern versions set the
required attribute on required fields, which meant that the form
couldn't be submitted due to the hidden fields for other backends. We
now dynamically set the required field based on the current backend
and the presence of a required CSS class on the label (which is
available on both).

Tested the form on Django 1.6 and 1.11. Checked for both validation
failures and successful validation.

Summary ID
Support validating cache backends on Django 1.6 and 1.11.
This adds support for validating the cache backend in the General Settings page on Django 1.11. We no longer have access to `get_cache()`, which was present on Django 1.6, so we now duplicate the functionality by importing the backend manually and then constructing an instance of the backend. In order to test this on Django 1.11, a change needed to be made to the cache field display logic for the form. Modern versions set the `required` attribute on required fields, which meant that the form couldn't be submitted due to the hidden fields for other backends. We now dynamically set the `required` field based on the current backend and the presence of a `required` CSS class on the label (which is available on both).
6eadf766c166bd8834a7caa3df1191b175198b7a
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (5d79cef)