Fix regressions with the Django 2.0 unique index quoting patch.
Review Request #11105 — Created July 30, 2020 and submitted
The new compatibility patch for Django 2.0 that quotes unique index
names didn't cover all the input cases. If either a
for the index name, or an explicit string was provided, it would assert.
Both of these cases are valid with the function the patch is overriding.
We now just check for these cases and only quote if all our criteria is
Verified that these conditions no longer crash on Django 2.0. (These are
triggered with some upcoming changes.)