Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade DRF #15144

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions awx/conf/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class StringListBooleanField(ListField):

def to_representation(self, value):
try:
if isinstance(value, str):
# https://github.com/encode/django-rest-framework/commit/a180bde0fd965915718b070932418cabc831cee1
# DRF changed truthy and falsy lists to be capitalized
value = value.lower()
if isinstance(value, (list, tuple)):
return super(StringListBooleanField, self).to_representation(value)
elif value in BooleanField.TRUE_VALUES:
Expand All @@ -78,6 +82,8 @@ def to_representation(self, value):

def to_internal_value(self, data):
try:
if isinstance(data, str):
data = data.lower()
if isinstance(data, (list, tuple)):
return super(StringListBooleanField, self).to_internal_value(data)
elif data in BooleanField.TRUE_VALUES:
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ django-pglocks
django-radius
django-solo
django-split-settings==1.0.0 # We hit a strange issue where the release process errored when upgrading past 1.0.0 see UPGRADE BLOCKERS
djangorestframework
djangorestframework>=3.15.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, its always good to add a comment if adding a pin

djangorestframework-yaml
filelock
GitPython>=3.1.37 # CVE-2023-41040
Expand Down
3 changes: 1 addition & 2 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ django-split-settings==1.0.0
# via
# -r /awx_devel/requirements/requirements.in
# django-ansible-base
djangorestframework==3.14.0
djangorestframework==3.15.1
# via
# -r /awx_devel/requirements/requirements.in
# django-ansible-base
Expand Down Expand Up @@ -387,7 +387,6 @@ python3-openid==3.2.0
# via -r /awx_devel/requirements/requirements_git.txt
pytz==2024.1
# via
# djangorestframework
# irc
# tempora
pyyaml==6.0.1
Expand Down
Loading