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 | ||
---|---|---|
61 | 61 |
from .passwords import get_password_checker |
62 | 62 |
from .custom_user.models import User |
63 | 63 |
from . import (utils, decorators, attribute_kinds, app_settings, hooks, |
64 |
api_mixins) |
|
64 |
api_mixins, validators)
|
|
65 | 65 |
from .models import Attribute, PasswordReset, Service |
66 | 66 |
from .a2_rbac.utils import get_default_ou |
67 | 67 | |
68 | 68 | |
69 |
# Retro-compatibility with Django 1.8 |
|
70 |
if django.VERSION < (1, 11): |
|
71 |
authentication.authenticate = utils.authenticate |
|
69 |
# Retro-compatibility with older Django versions |
|
70 |
if django.VERSION < (2,): |
|
71 |
import rest_framework.fields |
|
72 |
rest_framework.fields.ProhibitNullCharactersValidator = validators.ProhibitNullCharactersValidator |
|
73 |
if django.VERSION < (1, 11): |
|
74 |
authentication.authenticate = utils.authenticate |
|
72 | 75 | |
73 | 76 | |
74 | 77 |
class HookMixin(object): |
75 |
- |