• 
      

    Update URL patterns to use new path() and re_path().

    Review Request #12022 — Created Jan. 29, 2022 and submitted

    Information

    Review Board
    master

    Reviewers

    Django 2+ provides a new method for definings URLs, path(). This is
    much simpler for basic cases, and makes URL patterns more readable. In
    addition, the old url() method has been renamed to re_path(), and a
    warning is raised when using the old name, so switch to that too.

    As part of this, I changed the file attachment URLs to actually parse
    UUIDs using Django's new converter for that. This required making a
    change in the test create_file_attachment_base method to use real
    UUIDs instead of the string "test-uuid".

    Ran unit tests.

    Summary ID
    Update URL patterns to use new path() and re_path().
    Django 2+ provides a new method for definings URLs, `path()`. This is much simpler for basic cases, and makes URL patterns more readable. In addition, the old `url()` method has been renamed to `re_path()`, and a warning is raised when using the old name, so switch to that too. As part of this, I changed the file attachment URLs to actually parse UUIDs using Django's new converter for that. This required making a change in the test `create_file_attachment_base` method to use real UUIDs instead of the string "test-uuid". Testing Done: Ran unit tests.
    986690fae4a4de27c24130076e64cf251fe64447
    Description From Last Updated

    E231 missing whitespace after ','

    reviewbotreviewbot

    Second line isn't aligned right.

    chipx86chipx86

    Alignment isn't correct.

    chipx86chipx86

    This file's change seems unrelated.

    chipx86chipx86
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    david
    david
    chipx86
    1. 
        
    2. reviewboard/admin/urls.py (Diff revision 3)
       
       
       
      Show all issues

      Second line isn't aligned right.

    3. reviewboard/cmdline/rbext.py (Diff revision 3)
       
       
       
       
       
       
       
      Show all issues

      Alignment isn't correct.

    4. reviewboard/testing/testcase.py (Diff revision 3)
       
       
       
      Show all issues

      This file's change seems unrelated.

      1. Actually it is part of the change. I changed the file attachment URL to use the uuid converter, which actually parses UUID format. The old "test-uuid" string didn't parse anymore.

    5. 
        
    david
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to django-3.2 (a3249c8)