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

Update url to re_path in Django URL patterns #232

Merged
merged 1 commit into from
Feb 2, 2021
Merged

Update url to re_path in Django URL patterns #232

merged 1 commit into from
Feb 2, 2021

Conversation

Zinoex
Copy link
Contributor

@Zinoex Zinoex commented Nov 30, 2020

url is an alias to re_path, and url is likely to be deprecated in the future according to the Django docs.

…ath, and url is likely to be deprecated in the future according to the Django docs.
@codecov-io
Copy link

Codecov Report

Merging #232 (cef5beb) into next (fbaf833) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #232   +/-   ##
=======================================
  Coverage   82.42%   82.42%           
=======================================
  Files          30       30           
  Lines        2247     2247           
  Branches      157      157           
=======================================
  Hits         1852     1852           
  Misses        370      370           
  Partials       25       25           
Impacted Files Coverage Δ
kiosk/urls.py 100.00% <100.00%> (ø)
stregreport/urls.py 100.00% <100.00%> (ø)
stregsystem/urls.py 75.00% <100.00%> (ø)
treo/urls.py 66.66% <100.00%> (ø)

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 fbaf833...cef5beb. Read the comment docs.

@joandrsn
Copy link
Contributor

Could you link a source for the deprecation notice in Django docs?

@falkecarlsen
Copy link
Member

@Zinoex have you generally tested if urls still redirect as expected? kiosk, debug toolbar, stregsystem-frontend, admin, etc?

I'd like to see the docs as well. I'm all for future-proofing but we're on Django 2.2.13 LTS, so no breaking changes should be expected.

@Zinoex
Copy link
Contributor Author

Zinoex commented Nov 30, 2020

url is literally an alias for re_path according to the Django docs. The API has been marked for future deprecation since 2.0. I haven't tested the redirects yet as I'm not aware of how, but as url is an alias, it should be a direct drop-in replacement. The implementation of url is:

def url(regex, view, kwargs=None, name=None):
    return re_path(regex, view, kwargs, name)

@Zinoex
Copy link
Contributor Author

Zinoex commented Feb 2, 2021

@cogitantium Can we complete this PR?

Copy link
Member

@falkecarlsen falkecarlsen left a comment

Choose a reason for hiding this comment

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

@Zinoex, sure, it probably works despite neither of us have tested it. Due to lockdown it'll only be merged onto next for now. Actual release will be whenever we're allowed back at Cassiopeia and I'm able to upgrade.

@falkecarlsen falkecarlsen merged commit 7680c65 into f-klubben:next Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants