0001-misc-defer-null-character-check-in-api-to-submodule-.patch
src/authentic2/__init__.py | ||
---|---|---|
21 | 21 |
if django.VERSION < (2,): |
22 | 22 |
from . import validators |
23 | 23 |
from django.forms import fields |
24 |
import rest_framework.fields |
|
25 | 24 | |
26 | 25 |
# query-string and form parameters used to query database charfield must be checked for NULL characters |
27 | 26 |
# https://code.djangoproject.com/ticket/30064 |
... | ... | |
34 | 33 | |
35 | 34 |
fields.CharField.__init__ = CharField_new_init__ |
36 | 35 |
fields.CharField.a2_workaround = True |
37 |
rest_framework.fields.ProhibitNullCharactersValidator = validators.ProhibitNullCharactersValidator |
src/authentic2/api_views.py | ||
---|---|---|
66 | 66 |
from .a2_rbac.utils import get_default_ou |
67 | 67 | |
68 | 68 | |
69 |
# Retro-compatibility with Django 1.8 |
|
69 |
# Retro-compatibility with older Django versions |
|
70 |
if django.VERSION < (2,): |
|
71 |
import rest_framework.fields |
|
72 |
from . import validators |
|
73 |
rest_framework.fields.ProhibitNullCharactersValidator = validators.ProhibitNullCharactersValidator |
|
70 | 74 |
if django.VERSION < (1, 11): |
71 | 75 |
authentication.authenticate = utils.authenticate |
72 | 76 | |
73 |
- |