2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 21:16:46 +00:00

PEP fixes

This commit is contained in:
Oliver 2021-07-21 10:42:24 +10:00
parent 2d6a78ffb8
commit 8cb336f581

View File

@ -2,9 +2,6 @@
Validate that all URLs specified in template files are correct. Validate that all URLs specified in template files are correct.
""" """
from django import urls
from django.conf import settings
from django.test import TestCase from django.test import TestCase
from django.urls import reverse from django.urls import reverse
@ -110,9 +107,13 @@ class URLTest(TestCase):
url, pk = url_pair url, pk = url_pair
# TODO: Handle reverse lookup of admin URLs!
if url.startswith("admin:"):
return
if pk: if pk:
# We will assume that there is at least one item in the database # We will assume that there is at least one item in the database
reverse(url, kwargs={pk: 1}) reverse(url, kwargs={"pk": 1})
else: else:
reverse(url) reverse(url)