]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Use URL names in place of Python paths
authorStephen Finucane <stephen.finucane@intel.com>
Tue, 8 Dec 2015 15:09:00 +0000 (15:09 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Tue, 19 Jan 2016 21:55:26 +0000 (21:55 +0000)
Reversing by Python paths has been deprecated in Django 1.8, causes
warnings in Django 1.9 and will be removed in Django 2.0. Resolve the
warnings and prevent issues in the future by referring to URLs by name,
rather than by Python path.

https://docs.djangoproject.com/en/1.9/releases/1.8/#passing-a-dotted-path-to-reverse-and-url

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
40 files changed:
patchwork/models.py
patchwork/templates/patchwork/activation_email.txt
patchwork/templates/patchwork/bundle.html
patchwork/templates/patchwork/bundles.html
patchwork/templates/patchwork/filters.html
patchwork/templates/patchwork/help/pwclient.html
patchwork/templates/patchwork/login.html
patchwork/templates/patchwork/mail-settings.html
patchwork/templates/patchwork/optin-request.html
patchwork/templates/patchwork/optin-request.mail
patchwork/templates/patchwork/optin.html
patchwork/templates/patchwork/optout-request.html
patchwork/templates/patchwork/optout-request.mail
patchwork/templates/patchwork/optout.html
patchwork/templates/patchwork/patch-change-notification.mail
patchwork/templates/patchwork/patch-list.html
patchwork/templates/patchwork/patch.html
patchwork/templates/patchwork/profile.html
patchwork/templates/patchwork/project.html
patchwork/templates/patchwork/projects.html
patchwork/templates/patchwork/pwclientrc
patchwork/templates/patchwork/registration-confirm.html
patchwork/templates/patchwork/todo-lists.html
patchwork/templates/patchwork/user-link-confirm.html
patchwork/templates/patchwork/user-link.html
patchwork/templates/patchwork/user-link.mail
patchwork/templatetags/person.py
patchwork/tests/test_confirm.py
patchwork/tests/test_list.py
patchwork/tests/test_mail_settings.py
patchwork/tests/test_registration.py
patchwork/tests/test_updates.py
patchwork/tests/test_user.py
patchwork/tests/test_xmlrpc.py
patchwork/views/bundle.py
patchwork/views/patch.py
patchwork/views/project.py
patchwork/views/user.py
patchwork/views/xmlrpc.py
templates/base.html

index be25fbc2b710b64f51def9af0fd9cc79c55e26dc..b112a36cd7ae0653d8a119e9fffa60ec3d8d3ca8 100644 (file)
@@ -428,7 +428,7 @@ class Patch(models.Model):
 
     @models.permalink
     def get_absolute_url(self):
-        return ('patchwork.views.patch.patch', (), {'patch_id': self.id})
+        return ('patch-detail', (), {'patch_id': self.id})
 
     def __str__(self):
         return self.name
@@ -504,7 +504,7 @@ class Bundle(models.Model):
             return None
         site = Site.objects.get_current()
         return 'http://%s%s' % (site.domain,
-                                reverse('patchwork.views.bundle.bundle',
+                                reverse('bundle-detail',
                                         kwargs={
                                             'username': self.owner.username,
                                             'bundlename': self.name
@@ -512,7 +512,7 @@ class Bundle(models.Model):
 
     @models.permalink
     def get_absolute_url(self):
-        return ('patchwork.views.bundle.bundle', (), {
+        return ('bundle-detail', (), {
             'username': self.owner.username,
             'bundlename': self.name,
         })
index caf514a5573eaf2eed7395050659854a3c3fbcfe..34e2fce0ff6dd56e4c0ff7238fa98288038b0b0c 100644 (file)
@@ -3,7 +3,7 @@ Hi,
 This email is to confirm your account on the patchwork patch-tracking
 system. You can activate your account by visiting the url:
 
- http://{{site.domain}}{% url 'patchwork.views.confirm' key=confirmation.key %}
+ http://{{site.domain}}{% url 'confirm' key=confirmation.key %}
 
 If you didn't request a user account on patchwork, then you can ignore
 this mail.
index d71132d3e2512d89d819370bb70aa375d8a0f712..aa46e94dc1238207fb28e5d0d4f7349e7b701237 100644 (file)
@@ -16,7 +16,7 @@
 <p>This bundle contains patches for the {{ bundle.project.linkname }}
 project.</p>
 
-<p><a href="{% url 'patchwork.views.bundle.mbox' username=bundle.owner.username bundlename=bundle.name %}">Download bundle as mbox</a></p>
+<p><a href="{% url 'bundle-mbox' username=bundle.owner.username bundlename=bundle.name %}">Download bundle as mbox</a></p>
 
 {% if bundleform %}
 <form method="post">
index 11fb89dc47872d0f325e814204b038b17d584715..029379d83af8598e0d005ab80453608f5db5ab26 100644 (file)
@@ -28,7 +28,7 @@
   </td>
   <td style="text-align: right">{{ bundle.n_patches }}</td>
   <td style="text-align: center;"><a
-   href="{% url 'patchwork.views.bundle.mbox' username=bundle.owner.username bundlename=bundle.name %}"
+   href="{% url 'bundle-mbox' username=bundle.owner.username bundlename=bundle.name %}"
    ><img src="{% static "images/16-em-down.png" %}" width="16" height="16" alt="download"
    title="download"/></a></td>
   <td style="text-align: center;">
index acb9375e430c55d6d69bdf0aca9cf20593d393c1..3abfe24975ba5b027d354dca7f1df6b41ad82e8d 100644 (file)
@@ -70,7 +70,7 @@ $(document).ready(function() {
                 return callback();
 
             req = $.ajax({
-                url: '{% url 'patchwork.views.api.submitters' %}?q=' +
+                url: '{% url 'api-submitters' %}?q=' +
                       encodeURIComponent(query) + '&l=10',
                 error: function() {
                     callback();
index 793cf7379e2d981fd4c61fad6e066a324c67e275..e3fbc82e64967068a86809b1fa5f12e719d8f791 100644 (file)
@@ -11,13 +11,13 @@ and applying patches.</p>
 
 <p>To use pwclient, you will need:</p>
 <ul>
- <li>The <a href="{% url 'patchwork.views.pwclient.pwclient' %}">pwclient</a>
+ <li>The <a href="{% url 'pwclient' %}">pwclient</a>
   program (11kB, python script)</li>
  <li>(optional) a <code>.pwclientrc</code> file in your home directory.</li>
 </ul>
 
 <p>You can create your own <code>.pwclientrc</code> file. Each
-<a href="{% url 'patchwork.views.project.list' %}">patchwork project</a>
+<a href="{% url 'project-list' %}">patchwork project</a>
 provides a sample linked from the 'project info' page.</p>
 
 {% endblock %}
index a28cd31b6635d3502ae62c65eaccb4034df5ecb3..293ada3e84c15198a375dca20444439616e64075 100644 (file)
@@ -29,7 +29,7 @@
    <input type="submit" value="Login"/>
   </td>
   <td class="submitrow">
-   <a href="{% url 'django.contrib.auth.views.password_reset' %}">
+   <a href="{% url 'password_reset' %}">
      Forgot password?
    </a>
   </td>
index 440af087c6c8280a8be0538f5351f6d3efd25e03..ab0af4f91afec9b6bbed272844bb72c3193358b8 100644 (file)
   <td>Patchwork <strong>may not</strong> send automated notifications to
    this address.</td>
   <td>
-   <form method="post" action="{% url 'patchwork.views.mail.optin' %}">
+   <form method="post" action="{% url 'mail-optin' %}">
     {% csrf_token %}
     <input type="hidden" name="email" value="{{email}}"/>
     <input type="submit" value="Opt-in"/>
    </form>
   </td>
-   
+
 {% else %}
   <td>Patchwork <strong>may</strong> send automated notifications to
    this address.</td>
   <td>
-   <form method="post" action="{% url 'patchwork.views.mail.optout' %}">
+   <form method="post" action="{% url 'mail-optout' %}">
     {% csrf_token %}
     <input type="hidden" name="email" value="{{email}}"/>
     <input type="submit" value="Opt-out"/>
index 3dfb1bd810fe924bb44fcae801bb7bc7b696f347..ba7161487752f3a842ed177638dd60a7befef06d 100644 (file)
@@ -43,7 +43,7 @@ without your consent.</p>
 {% endif %}
 
 {% if user.is_authenticated %}
-<p>Return to your <a href="{% url 'patchwork.views.user.profile' %}">user
+<p>Return to your <a href="{% url 'user-profile' %}">user
 profile</a>.</p>
 {% endif %}
 
index d97c78b18edc3bfcb60ee66629f5bcf11a731349..fb4814bf3731dccad7c725ad33a05648c8e20f58 100644 (file)
@@ -5,7 +5,7 @@ email from the patchwork system at {{site.domain}}.
 
 To complete the opt-in process, visit:
 
- http://{{site.domain}}{% url 'patchwork.views.confirm' key=confirmation.key %}
+ http://{{site.domain}}{% url 'confirm' key=confirmation.key %}
 
 If you didn't request this opt-in, you don't need to do anything.
 
index 01aaa0e2c6452595dd8bc9973d4e3c6aa7c4b08e..905619103c79287cc0c35b488638f18e1b6d067f 100644 (file)
@@ -9,11 +9,11 @@
 automated email from this patchwork system, using the address
 <strong>{{email}}</strong>.</p>
 <p>If you later decide that you no longer want to receive automated mail from
-patchwork, just visit <a href="{% url 'patchwork.views.mail.settings' %}"
->http://{{site.domain}}{% url 'patchwork.views.mail.settings' %}</a>, or
+patchwork, just visit <a href="{% url 'mail-settings' %}"
+>http://{{site.domain}}{% url 'mail-settings' %}</a>, or
 visit the main patchwork page and navigate from there.</p>
 {% if user.is_authenticated %}
-<p>Return to your <a href="{% url 'patchwork.views.user.profile' %}">user
+<p>Return to your <a href="{% url 'user-profile' %}">user
 profile</a>.</p>
 {% endif %}
 {% endblock %}
index 092dbbbf3d5339a04f74fbccbf6454c8c1185d4c..c043dc77fc92ac7673ef47238e2af5563dab2880 100644 (file)
@@ -44,7 +44,7 @@ without your consent.</p>
 {% endif %}
 
 {% if user.is_authenticated %}
-<p>Return to your <a href="{% url 'patchwork.views.user.profile' %}">user
+<p>Return to your <a href="{% url 'user-profile' %}">user
 profile</a>.</p>
 {% endif %}
 
index 67203caad1e5123225c36d9aba5e91a0774c134e..8a3e46fd5859269a2c21b8e284eda215afab1d87 100644 (file)
@@ -5,7 +5,7 @@ from the patchwork system at {{site.domain}}.
 
 To complete the opt-out process, visit:
 
- http://{{site.domain}}{% url 'patchwork.views.confirm' key=confirmation.key %}
+ http://{{site.domain}}{% url 'confirm' key=confirmation.key %}
 
 If you didn't request this opt-out, you don't need to do anything.
 
index b140bf49760a8e003952f3879e246c11958d5f6d..6a325039a03d6a8e35f5abb4b44ebb168b77f234 100644 (file)
@@ -12,11 +12,11 @@ automated notifications from this patchwork system, from the address
 different sites, as they are run independently. You may need to opt-out of
 those separately.</p>
 <p>If you later decide to receive mail from patchwork, just visit
-<a href="{% url 'patchwork.views.mail.settings' %}"
->http://{{site.domain}}{% url 'patchwork.views.mail.settings' %}</a>, or
+<a href="{% url 'mail-settings' %}"
+>http://{{site.domain}}{% url 'mail-settings' %}</a>, or
 visit the main patchwork page and navigate from there.</p>
 {% if user.is_authenticated %}
-<p>Return to your <a href="{% url 'patchwork.views.user.profile' %}">user
+<p>Return to your <a href="{% url 'user-profile' %}">user
 profile</a>.</p>
 {% endif %}
 {% endblock %}
index 4246704b33304aa34f995b05e6ea1fedf2622b8b..0047fdbe72403448e2d583c2d59bba842a448327 100644 (file)
@@ -17,4 +17,4 @@ Happy patchworking.
 This is an automated mail sent by the patchwork system at
 {{site.domain}}. To stop receiving these notifications, edit
 your mail settings at:
-  http://{{site.domain}}{% url 'patchwork.views.mail.settings' %}
+  http://{{site.domain}}{% url 'mail-settings' %}
index 165b079471b462c11a19825b53493fba577f0513..bcbb3b92d3c6eeb154ed8a986919af87dc60766f 100644 (file)
@@ -155,7 +155,7 @@ $(document).ready(function() {
     <input type="checkbox" name="patch_id:{{patch.id}}"/>
     </td>
     {% endif %}
-   <td><a href="{% url 'patchwork.views.patch.patch' patch_id=patch.id %}"
+   <td><a href="{% url 'patch-detail' patch_id=patch.id %}"
      >{{ patch.name|default:"[no subject]"|truncatechars:100 }}</a></td>
    <td style="white-space: nowrap;">{{ patch|patch_tags }}</td>
    <td style="white-space: nowrap;">{{ patch|patch_checks }}</td>
index 37a3bebcd8dfbbb2c6f06c845500a19dc683f81f..f3793179f457e8c1f4587dbac70a34a3cb668a8a 100644 (file)
@@ -7,7 +7,7 @@
 
 {% block title %}{{patch.name}}{% endblock %}
 {% block breadcrumb %}
-<a href="{% url 'patchwork.views.patch.list' project_id=project.linkname %}"
+<a href="{% url 'patch-list' project_id=project.linkname %}"
  >{{ project.linkname }} patches</a>
  &#8594;
  {{ patch.name }}
@@ -216,11 +216,11 @@ function toggle_headers(link_id, headers_id)
  <a href="javascript:toggle_headers('hide-patch', 'patch')" id="hide-patch">hide</a></span>
 {% if patch.content %}
  <span>|</span>
- <a href="{% url 'patchwork.views.patch.content' patch_id=patch.id %}"
+ <a href="{% url 'patch-raw' patch_id=patch.id %}"
    >download patch</a>
 {% endif %}
  <span>|</span>
- <a href="{% url 'patchwork.views.patch.mbox' patch_id=patch.id %}"
+ <a href="{% url 'patch-mbox' patch_id=patch.id %}"
    >download mbox</a>
 </h2>
 <div id="patch" class="patch">
index 116d6d63bfdf575bb6f903b8832b1293327cea10..04fe12ed06599c75339afab6f2a7551cc2ecbb6c 100644 (file)
 {% if user.profile.maintainer_projects.count %}
 Maintainer of
 {% for project in user.profile.maintainer_projects.all %}
-<a href="{% url 'patchwork.views.patch.list' project_id=project.linkname %}"
+<a href="{% url 'patch-list' project_id=project.linkname %}"
 >{{ project.linkname }}</a>{% if not forloop.last %},{% endif %}{% endfor %}.
 {% endif %}
 
 {% if user.profile.contributor_projects.count %}
 Contributor to
 {% for project in user.profile.contributor_projects.all %}
-<a href="{% url 'patchwork.views.patch.list' project_id=project.linkname %}"
+<a href="{% url 'patch-list' project_id=project.linkname %}"
 >{{ project.linkname }}</a>{% if not forloop.last %},{% endif %}{% endfor %}.
 {% endif %}
 </p>
@@ -26,7 +26,7 @@ Contributor to
 <div class="box">
  <h2>Todo</h2>
 {% if user.profile.n_todo_patches %}
- <p>Your <a href="{% url 'patchwork.views.user.todo_lists' %}">todo
+ <p>Your <a href="{% url 'user-todo' %}">todo
   list</a> contains {{ user.profile.n_todo_patches }}
   patch{{ user.profile.n_todo_patches|pluralize:"es" }}.</p>
 {% else %}
@@ -56,7 +56,7 @@ address.</p>
   <td>{{ email.email }}</td>
   <td>
   {% ifnotequal user.email email.email %}
-   <form action="{% url 'patchwork.views.user.unlink' person_id=email.id %}"
+   <form action="{% url 'user-unlink' person_id=email.id %}"
     method="post">
     {% csrf_token %}
     <input type="submit" value="Unlink"/>
@@ -65,14 +65,14 @@ address.</p>
   </td>
   <td>
    {% if email.is_optout %}
-   <form method="post" action="{% url 'patchwork.views.mail.optin' %}">
+   <form method="post" action="{% url 'mail-optin' %}">
     No,
      {% csrf_token %}
      <input type="hidden" name="email" value="{{email.email}}"/>
      <input type="submit" value="Opt-in"/>
     </form>
    {% else %}
-    <form method="post" action="{% url 'patchwork.views.mail.optout' %}">
+    <form method="post" action="{% url 'mail-optout' %}">
     Yes,
      {% csrf_token %}
      <input type="hidden" name="email" value="{{email.email}}"/>
@@ -84,7 +84,7 @@ address.</p>
 {% endfor %}
  <tr>
   <td colspan="3">
-   <form action="{% url 'patchwork.views.user.link' %}" method="post">
+   <form action="{% url 'user-link' %}" method="post">
     {% csrf_token %}
     {{ linkform.email }}
     <input type="submit" value="Add"/>
@@ -107,7 +107,7 @@ address.</p>
  <li><a href="{{ bundle.get_absolute_url }}">{{ bundle.name }}</a></li>
 {% endfor %}
 </ul>
-<p>Visit the <a href="{%url 'patchwork.views.bundle.bundles' %}">bundles
+<p>Visit the <a href="{%url 'bundle-list' %}">bundles
  page</a> to manage your bundles.</p>
 {% else %}
 <p>You have no bundles.</p>
@@ -134,7 +134,7 @@ address.</p>
 
 <div class="box">
 <h2>Authentication</h2>
-<a href="{% url 'django.contrib.auth.views.password_change' %}">Change password</a>
+<a href="{% url 'password_change' %}">Change password</a>
 </div>
 
 </div>
index e1cf3f5f87783d7be20039eed143c34da9cfb2bb..eeb83ad311c395d507bde4f38bdcbe8eacccfef4 100644 (file)
@@ -49,9 +49,9 @@
 </table>
 
 {% if settings.ENABLE_XMLRPC %}
-<p>Sample <a href="{% url 'patchwork.views.help.help' "pwclient/" %}">patchwork
+<p>Sample <a href="{% url 'help' "pwclient/" %}">patchwork
 client</a> configuration for this project: <a
-href="{% url 'patchwork.views.pwclient.pwclientrc' project.linkname %}"
+href="{% url 'pwclientrc' project.linkname %}"
 >.pwclientrc</a>.</p>
 {% endif %}
   
index 8c727ad12fdb55c0b7897f3da4a91f893c47883e..543a1d4390c1c46757f431ece7adbf61bec3c999 100644 (file)
@@ -10,7 +10,7 @@
  {% for p in projects %}
  <div class="project">
   <h2 class="project-title">
-   <a href="{% url 'patchwork.views.patch.list' project_id=p.linkname %}"
+   <a href="{% url 'patch-list' project_id=p.linkname %}"
     >{{p.linkname}}</a>
   </h2>
   <div class="project-name">{{p.name}}</div>
index d331003a269d96f77db0fd3a13154a8988bde0c0..96464c1be0b90f503d8a5ae18246b107b2803098 100644 (file)
@@ -8,7 +8,7 @@
 # default={{ project.linkname }}
 
 [{{ project.linkname }}]
-url= {{scheme}}://{{site.domain}}{% url 'patchwork.views.xmlrpc.xmlrpc' %}
+url= {{scheme}}://{{site.domain}}{% url 'xmlrpc' %}
 {% if user.is_authenticated %}
 username: {{ user.username }}
 password: <add your patchwork password here>
index 61114014b84f039c60f926f73470582aa0aa3bf5..d40c30508b0e9d5923c2c6abc79853897502d62b 100644 (file)
@@ -7,7 +7,7 @@
 <p>Registraton confirmed!</p>
 
 <p>Your patchwork registration is complete. Head over to your <a
- href="{% url 'patchwork.views.user.profile' %}">profile</a> to start using
+ href="{% url 'user-profile' %}">profile</a> to start using
 patchwork's extra features.</p>
 
 {% endblock %}
index e268160bb5360b887aa0f52588b78f0db013f19e..6365f59ab39db46fcf5f2006ecf79b419687d0b3 100644 (file)
@@ -16,7 +16,7 @@
 {% for todo_list in todo_lists %}
  <tr>
   <td><a
-   href="{% url 'patchwork.views.user.todo_list' project_id=todo_list.project.linkname %}"
+   href="{% url 'user-todo-project' project_id=todo_list.project.linkname %}"
     >{{ todo_list.project.name }}</a></td>
   <td class="numberformat">{{ todo_list.n_patches }}</td>
  </tr>
index 449bfebbe38a040a630e08b48e1b67767d412686..051a13c1634a6265d872627e6eea81fc5768acd8 100644 (file)
@@ -13,7 +13,7 @@
   your patchwork account</p>
 
 {% endif %}
-<p>Back to <a href="{% url 'patchwork.views.user.profile' %}">your
+<p>Back to <a href="{% url 'user-profile' %}">your
  profile</a>.</p>
 
 {% endblock %}
index e436c3a3313948f34228f3cd8a34604b35207735..bf30cec8acc6a7eb8d881f6090213bfae53f47b9 100644 (file)
@@ -21,7 +21,7 @@ you.</p>
     <ul class="errorlist"><li>{{error}}</li></ul>
    {% endif %}
 
-   <form action="{% url 'patchwork.views.user.link' %}" method="post">
+   <form action="{% url 'user-link' %}" method="post">
     {% csrf_token %}
     {{linkform.email.errors}}
     Link an email address: {{ linkform.email }}
index 8db672648517b8d31c28f874aff4de7789f9237d..ac4d540068e0db30fd3fe1416a476bf5ed224424 100644 (file)
@@ -7,6 +7,6 @@ This email is to confirm that you own the email address:
 So that you can add it to your patchwork profile. You can confirm this
 email address by visiting the url:
 
- http://{{site.domain}}{% url 'patchwork.views.confirm' key=confirmation.key %}
+ http://{{site.domain}}{% url 'confirm' key=confirmation.key %}
 
 Happy patchworking.
index d35203b5ad75486e9d37c93ab14026b0acc8cb9b..7af021f0c28b6a6e960465ab1244f1ad7db56953 100644 (file)
@@ -38,7 +38,7 @@ def personify(person, project):
     else:
         linktext = escape(person.email)
 
-    url = reverse('patchwork.views.patch.list',
+    url = reverse('patch-list',
                   kwargs={'project_id': project.linkname})
     str = '<a href="%s?%s=%s">%s</a>' % (
         url, SubmitterFilter.param, escape(person.id), linktext)
index 7ef922e013b591d22b696c0fc0cba8fc87f4b8f0..5c5c69e59191a6d097f75eb738a001c48fb8e76d 100644 (file)
@@ -25,8 +25,7 @@ from patchwork.models import EmailConfirmation, Person
 
 
 def _confirmation_url(conf):
-    return reverse('patchwork.views.confirm',
-                   kwargs={'key': conf.key})
+    return reverse('confirm', kwargs={'key': conf.key})
 
 
 class TestUser(object):
index 886285805247ab4d76abb9d2344d54fb5e6082ac..0cc33fcf32f95ad4a0120fe7e8334da105792a07 100644 (file)
@@ -37,8 +37,7 @@ class EmptyPatchListTest(TestCase):
            patches present"""
         project = defaults.project
         defaults.project.save()
-        url = reverse('patchwork.views.patch.list',
-                      kwargs={'project_id': project.linkname})
+        url = reverse('patch-list', kwargs={'project_id': project.linkname})
         response = self.client.get(url)
         self.assertContains(response, 'No patches to display')
         self.assertNotContains(response, 'tbody')
@@ -96,7 +95,7 @@ class PatchOrderTest(TestCase):
         [test_fn(p1, p2) for (p1, p2) in pairs]
 
     def testDateOrder(self):
-        url = reverse('patchwork.views.patch.list',
+        url = reverse('patch-list',
                       kwargs={'project_id': defaults.project.linkname})
         response = self.client.get(url + '?order=date')
 
@@ -105,7 +104,7 @@ class PatchOrderTest(TestCase):
         self._test_sequence(response, test_fn)
 
     def testDateReverseOrder(self):
-        url = reverse('patchwork.views.patch.list',
+        url = reverse('patch-list',
                       kwargs={'project_id': defaults.project.linkname})
         response = self.client.get(url + '?order=-date')
 
@@ -114,7 +113,7 @@ class PatchOrderTest(TestCase):
         self._test_sequence(response, test_fn)
 
     def testSubmitterOrder(self):
-        url = reverse('patchwork.views.patch.list',
+        url = reverse('patch-list',
                       kwargs={'project_id': defaults.project.linkname})
         response = self.client.get(url + '?order=submitter')
 
@@ -124,7 +123,7 @@ class PatchOrderTest(TestCase):
         self._test_sequence(response, test_fn)
 
     def testSubmitterReverseOrder(self):
-        url = reverse('patchwork.views.patch.list',
+        url = reverse('patch-list',
                       kwargs={'project_id': defaults.project.linkname})
         response = self.client.get(url + '?order=-submitter')
 
index 02205aa41549c3279b3a9daf8ba811b424d0088f..954e3e8ae047053f94f7ac8ed7b10da33e6396db 100644 (file)
@@ -30,7 +30,7 @@ from patchwork.tests.utils import create_user, error_strings
 class MailSettingsTest(TestCase):
 
     def setUp(self):
-        self.url = reverse('patchwork.views.mail.settings')
+        self.url = reverse('mail-settings')
 
     def testMailSettingsGET(self):
         response = self.client.get(self.url)
@@ -64,7 +64,7 @@ class MailSettingsTest(TestCase):
         self.assertTemplateUsed(response, 'patchwork/mail-settings.html')
         self.assertEqual(response.context['is_optout'], False)
         self.assertContains(response, '<strong>may</strong>')
-        optout_url = reverse('patchwork.views.mail.optout')
+        optout_url = reverse('mail-optout')
         self.assertContains(response, ('action="%s"' % optout_url))
 
     def testMailSettingsPOSTOptedOut(self):
@@ -75,19 +75,19 @@ class MailSettingsTest(TestCase):
         self.assertTemplateUsed(response, 'patchwork/mail-settings.html')
         self.assertEqual(response.context['is_optout'], True)
         self.assertContains(response, '<strong>may not</strong>')
-        optin_url = reverse('patchwork.views.mail.optin')
+        optin_url = reverse('mail-optin')
         self.assertContains(response, ('action="%s"' % optin_url))
 
 
 class OptoutRequestTest(TestCase):
 
     def setUp(self):
-        self.url = reverse('patchwork.views.mail.optout')
+        self.url = reverse('mail-optout')
 
     def testOptOutRequestGET(self):
         response = self.client.get(self.url)
         self.assertRedirects(
-            response, reverse('patchwork.views.mail.settings'))
+            response, reverse('mail-settings'))
 
     def testOptoutRequestValidPOST(self):
         email = u'foo@example.com'
@@ -103,7 +103,7 @@ class OptoutRequestTest(TestCase):
         self.assertContains(response, email)
 
         # check email
-        url = reverse('patchwork.views.confirm', kwargs={'key': conf.key})
+        url = reverse('confirm', kwargs={'key': conf.key})
         self.assertEqual(len(mail.outbox), 1)
         msg = mail.outbox[0]
         self.assertEqual(msg.to, [email])
@@ -131,14 +131,13 @@ class OptoutRequestTest(TestCase):
 class OptoutTest(TestCase):
 
     def setUp(self):
-        self.url = reverse('patchwork.views.mail.optout')
+        self.url = reverse('mail-optout')
         self.email = u'foo@example.com'
         self.conf = EmailConfirmation(type='optout', email=self.email)
         self.conf.save()
 
     def testOptoutValidHash(self):
-        url = reverse('patchwork.views.confirm',
-                      kwargs={'key': self.conf.key})
+        url = reverse('confirm', kwargs={'key': self.conf.key})
         response = self.client.get(url)
 
         self.assertEqual(response.status_code, 200)
@@ -166,14 +165,13 @@ class OptoutPreexistingTest(OptoutTest):
 class OptinRequestTest(TestCase):
 
     def setUp(self):
-        self.url = reverse('patchwork.views.mail.optin')
+        self.url = reverse('mail-optin')
         self.email = u'foo@example.com'
         EmailOptout(email=self.email).save()
 
     def testOptInRequestGET(self):
         response = self.client.get(self.url)
-        self.assertRedirects(
-            response, reverse('patchwork.views.mail.settings'))
+        self.assertRedirects(response, reverse('mail-settings'))
 
     def testOptInRequestValidPOST(self):
         response = self.client.post(self.url, {'email': self.email})
@@ -188,8 +186,7 @@ class OptinRequestTest(TestCase):
         self.assertContains(response, self.email)
 
         # check email
-        url = reverse('patchwork.views.confirm',
-                      kwargs={'key': conf.key})
+        url = reverse('confirm', kwargs={'key': conf.key})
         self.assertEqual(len(mail.outbox), 1)
         msg = mail.outbox[0]
         self.assertEqual(msg.to, [self.email])
@@ -224,8 +221,7 @@ class OptinTest(TestCase):
         self.conf.save()
 
     def testOptinValidHash(self):
-        url = reverse('patchwork.views.confirm',
-                      kwargs={'key': self.conf.key})
+        url = reverse('confirm', kwargs={'key': self.conf.key})
         response = self.client.get(url)
 
         self.assertEqual(response.status_code, 200)
@@ -245,7 +241,7 @@ class OptinWithoutOptoutTest(TestCase):
     """Test an opt-in with no existing opt-out"""
 
     def setUp(self):
-        self.url = reverse('patchwork.views.mail.optin')
+        self.url = reverse('mail-optin')
 
     def testOptInWithoutOptout(self):
         email = u'foo@example.com'
@@ -263,9 +259,9 @@ class UserProfileOptoutFormTest(TestCase):
        page, for logged-in users"""
 
     def setUp(self):
-        self.url = reverse('patchwork.views.user.profile')
-        self.optout_url = reverse('patchwork.views.mail.optout')
-        self.optin_url = reverse('patchwork.views.mail.optin')
+        self.url = reverse('user-profile')
+        self.optout_url = reverse('mail-optout')
+        self.optin_url = reverse('mail-optin')
         self.form_re_template = ('<form\s+[^>]*action="%(url)s"[^>]*>'
                                  '.*?<input\s+[^>]*value="%(email)s"[^>]*>.*?'
                                  '</form>')
index b5f5bb4421875d05d68448c703b28c5cfd634063..998dd6fdc1d6486e92952c3b77e71891f0c28da7 100644 (file)
@@ -28,8 +28,7 @@ from patchwork.tests.utils import create_user
 
 
 def _confirmation_url(conf):
-    return reverse('patchwork.views.confirm',
-                   kwargs={'key': conf.key})
+    return reverse('confirm', kwargs={'key': conf.key})
 
 
 class TestUser(object):
index a8d9749b6c7c51365f9e47f0d54bb2b2b90f4bc6..d40a0a2bbafd0055e365bfc0ff5c7fb8cb724661 100644 (file)
@@ -33,8 +33,7 @@ class MultipleUpdateTest(TestCase):
         self.client.login(username=self.user.username,
                           password=self.user.username)
         self.properties_form_id = 'patchform-properties'
-        self.url = reverse(
-            'patchwork.views.patch.list', args=[defaults.project.linkname])
+        self.url = reverse('patch-list', args=[defaults.project.linkname])
         self.base_data = {
             'action': 'Update', 'project': str(defaults.project.id),
             'form': 'patchlistform', 'archived': '*', 'delegate': '*',
index 3df5ffa5ca53e76e6d0fc2ce76005b0519d400ef..c27328e16e404e903afb0ba59d3580b6d6e0edb1 100644 (file)
@@ -28,8 +28,7 @@ from patchwork.tests.utils import defaults, error_strings
 
 
 def _confirmation_url(conf):
-    return reverse('patchwork.views.confirm',
-                   kwargs={'key': conf.key})
+    return reverse('confirm', kwargs={'key': conf.key})
 
 
 class TestUser(object):
@@ -188,9 +187,8 @@ class UserPasswordChangeTest(TestCase):
     user = None
 
     def setUp(self):
-        self.form_url = reverse('django.contrib.auth.views.password_change')
-        self.done_url = reverse(
-            'django.contrib.auth.views.password_change_done')
+        self.form_url = reverse('password_change')
+        self.done_url = reverse('password_change_done')
 
     def testPasswordChangeForm(self):
         self.user = TestUser()
index d8e1d98c48235d54bd6fb522e6527bda5d2dfb48..e70ed30ae0b28e05fca8e4aff9d99cbcb096be1e 100644 (file)
@@ -35,15 +35,13 @@ class XMLRPCTest(LiveServerTestCase):
     fixtures = ['default_states']
 
     def setUp(self):
-        self.url = (self.live_server_url +
-                    reverse('patchwork.views.xmlrpc.xmlrpc'))
+        self.url = (self.live_server_url + reverse('xmlrpc'))
         self.rpc = xmlrpc_client.Server(self.url)
 
     def testGetRedirect(self):
         response = self.client.patch(self.url)
         self.assertRedirects(response,
-                             reverse('patchwork.views.help.help',
-                                     kwargs={'path': 'pwclient/'}))
+                             reverse('help', kwargs={'path': 'pwclient/'}))
 
     def testList(self):
         defaults.project.save()
index c180cde5fb646097af55402f05367efb08770cd7..9b88be9b1265ac9a13b91cc22532439e79c9ee0a 100644 (file)
@@ -96,14 +96,13 @@ def setbundle(request):
     if bundle:
         return HttpResponseRedirect(
             django.core.urlresolvers.reverse(
-                'patchwork.views.bundle.bundle',
+                'bundle-detail',
                 kwargs={'bundle_id': bundle.id}
             )
         )
     else:
         return HttpResponseRedirect(
-            django.core.urlresolvers.reverse(
-                'patchwork.views.bundle.list')
+            django.core.urlresolvers.reverse('bundle-list')
         )
 
 
@@ -147,8 +146,7 @@ def bundle(request, username, bundlename):
             if action == 'delete':
                 bundle.delete()
                 return HttpResponseRedirect(
-                    django.core.urlresolvers.reverse(
-                        'patchwork.views.user.profile')
+                    django.core.urlresolvers.reverse('user-profile')
                 )
             elif action == 'update':
                 form = BundleForm(request.POST, instance=bundle)
@@ -183,7 +181,7 @@ def bundle(request, username, bundlename):
         form = None
 
     context = generic_list(request, bundle.project,
-                           'patchwork.views.bundle.bundle',
+                           'bundle-detail',
                            view_args={'username': bundle.owner.username,
                                       'bundlename': bundle.name},
                            filter_settings=filter_settings,
@@ -224,7 +222,7 @@ def bundle_redir(request, bundle_id):
 def mbox_redir(request, bundle_id):
     bundle = get_object_or_404(Bundle, id=bundle_id, owner=request.user)
     return HttpResponseRedirect(django.core.urlresolvers.reverse(
-                                'patchwork.views.bundle.mbox', kwargs={
+                                'bundle-mbox', kwargs={
                                     'username': request.user.username,
                                     'bundlename': bundle.name,
                                 }))
index f91b6273ce4f8143e1dd6c3544213dd47e026d17..e739c9082818b148e56b49b6b7321ddc1cd0d315 100644 (file)
@@ -112,6 +112,6 @@ def mbox(request, patch_id):
 
 def list(request, project_id):
     project = get_object_or_404(Project, linkname=project_id)
-    context = generic_list(request, project, 'patchwork.views.patch.list',
+    context = generic_list(request, project, 'patch-list',
                            view_args={'project_id': project.linkname})
     return render_to_response('patchwork/list.html', context)
index e3f37471ef644181ef96ab9c522a1b4d3a3e5e5d..5bc34e9beea9fa3d380eca3b67496a5aed5339a8 100644 (file)
@@ -34,7 +34,7 @@ def list(request):
 
     if projects.count() == 1:
         return HttpResponseRedirect(
-            urlresolvers.reverse('patchwork.views.patch.list',
+            urlresolvers.reverse('patch-list',
                                  kwargs={'project_id': projects[0].linkname}))
 
     context['projects'] = projects
index 529a3bd30985da8b107c0c4571a89655b9fbc060..d6e579748d17713a7322e6fe1cf733fe8fb8be5a 100644 (file)
@@ -184,7 +184,7 @@ def unlink(request, person_id):
             person.user = None
             person.save()
 
-    url = django.core.urlresolvers.reverse('patchwork.views.user.profile')
+    url = django.core.urlresolvers.reverse('user-profile')
     return HttpResponseRedirect(url)
 
 
index d928400caf87f98b1238207feeaf00fa2aa25929..28fd03bddbaa9c00a9348c5b987469196f35406b 100644 (file)
@@ -136,7 +136,7 @@ dispatcher = PatchworkXMLRPCDispatcher()
 @csrf_exempt
 def xmlrpc(request):
     if request.method not in ['POST', 'GET']:
-        return HttpResponseRedirect(reverse('patchwork.views.help.help',
+        return HttpResponseRedirect(reverse('help',
                                             kwargs={'path': 'pwclient/'}))
 
     response = HttpResponse()
index b6f7056ea5877eee234124890f50412a64a1fa3d..dec904ba1d867d52c52e24aac45097de5db4a2c1 100644 (file)
         <span class="icon-bar"></span>
       </button>
       <span class="navbar-brand"><a
-         href="{% url 'patchwork.views.project.list' %}">Patchwork</a>
+         href="{% url 'project-list' %}">Patchwork</a>
        {% block heading %}{% endblock %}</span>
     </div>
     <div class="collapse navbar-collapse" id="navbar-collapse">
      <ul class="nav navbar-nav navbar-right">
 {% if project %}
-     <li><a href="{% url 'patchwork.views.project.project' project_id=project.linkname %}"
+     <li><a href="{% url 'project-detail' project_id=project.linkname %}"
       >Project Info</a></li>
     <li><p class="navbar-text">|</p></li>
 {% endif %}
 {% if user.is_authenticated %}
-     <li><a href="{% url 'patchwork.views.user.todo_lists' %}">Todo
+     <li><a href="{% url 'user-todos' %}">Todo
       <span class="badge">{{ user.profile.n_todo_patches }}</span></a>
      </li>
-     <li><a href="{% url 'patchwork.views.bundle.bundles' %}">Bundles</a></li>
+     <li><a href="{% url 'bundle-list' %}">Bundles</a></li>
 {% if user.is_staff %}
      <li><a href="{% url 'admin:index' %}">Admin</a></li>
 {% endif %}
         ><strong>{{ user.username }}</strong>&nbsp;<span
         class="caret" /></a>
        <ul class="dropdown-menu" role="menu">
-         <li><a href="{% url 'patchwork.views.user.profile' %}">View profile</a></li>
+         <li><a href="{% url 'user-profile' %}">View profile</a></li>
          <li><a href="{% url 'auth_logout' %}">Logout</a></li>
        </ul>
      </li>
 {% else %}
      <li><a href="{% url 'auth_login' %}">Login</a></li>
-     <li><a href="{% url 'patchwork.views.user.register' %}">Register</a></li>
-     <li><a href="{% url 'patchwork.views.mail.settings' %}">Mail settings</a></li>
+     <li><a href="{% url 'user-register' %}">Register</a></li>
+     <li><a href="{% url 'mail-settings' %}">Mail settings</a></li>
 {% endif %}
     </div>
    </div>
 {% if project %}
   <div id="breadcrumb">
    <div id="breadcrumb-left">
-     <a href="{% url 'patchwork.views.project.list' %}">All projects</a>
+     <a href="{% url 'project-list' %}">All projects</a>
      &#8594;
      {% block breadcrumb %}
-      <a href="{% url 'patchwork.views.patch.list' project_id=project.linkname %}"
+      <a href="{% url 'patch-list' project_id=project.linkname %}"
        >{{ project.linkname }} patches</a>
      {% endblock %}
    </div>
@@ -96,7 +96,7 @@
   <div id="footer">
    <a href="http://jk.ozlabs.org/projects/patchwork/">patchwork</a>
    patch tracking system | <a
-   href="{% url 'patchwork.views.help.help' path="about/" %}">about patchwork</a>
+   href="{% url 'help' path="about/" %}">about patchwork</a>
   </div>
  </body>
 </html>