Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove uses of Django 3.0 deprecations #1789

Merged
merged 3 commits into from
Oct 16, 2021
Merged

Conversation

quantum5
Copy link
Member

@quantum5 quantum5 commented Oct 3, 2021

This PR removes references to django.utils.http.urlquote, django.utils.translation.ugettext, django.utils.translation.ungettext, which are aliases of other functions on Python 3. It's okay to drop them now since we don't need Python 2 support, and we want to discourage these being cargo culted.

This is just an alias of urllib.parse.quote on Python 3, and it's
deprecated starting Django 3.0.
This is just an alias of django.utils.translation.gettext on Python 3,
and it's deprecated starting Django 3.0.
@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2021

Codecov Report

Merging #1789 (520d21d) into master (b785d89) will not change coverage.
The diff coverage is 45.71%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1789   +/-   ##
=======================================
  Coverage   46.20%   46.20%           
=======================================
  Files         223      223           
  Lines       12676    12676           
=======================================
  Hits         5857     5857           
  Misses       6819     6819           
Impacted Files Coverage Δ
judge/utils/problems.py 26.86% <ø> (ø)
judge/admin/contest.py 44.97% <14.28%> (ø)
judge/admin/problem.py 57.23% <25.00%> (ø)
judge/admin/comments.py 71.42% <33.33%> (ø)
judge/admin/submission.py 45.26% <33.33%> (ø)
judge/middleware.py 30.00% <33.33%> (ø)
judge/admin/profile.py 62.22% <50.00%> (ø)
judge/contest_format/atcoder.py 30.98% <50.00%> (ø)
judge/contest_format/ecoo.py 28.57% <50.00%> (ø)
judge/utils/timedelta.py 5.17% <50.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b785d89...520d21d. Read the comment docs.

This is just an alias of django.utils.translation.ngettext on Python 3,
and it's deprecated starting Django 3.0.
@quantum5 quantum5 force-pushed the django-3-deprecation branch from f417b53 to 520d21d Compare October 3, 2021 06:13
Copy link
Member

@kiritofeng kiritofeng left a comment

Choose a reason for hiding this comment

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

LGTM

@quantum5 quantum5 merged commit ce30a09 into master Oct 16, 2021
@quantum5 quantum5 deleted the django-3-deprecation branch October 16, 2021 01:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants