Fix linting failures

This commit is contained in:
Neil Martinsen-Burrell 2022-10-28 09:22:33 -05:00
parent 53906d339f
commit b425a45ef2
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
4 changed files with 15 additions and 4 deletions

View file

@ -27,3 +27,4 @@ flake8 = "*"
mypy = "*" mypy = "*"
types-requests = "*" types-requests = "*"
django-stubs = "*" django-stubs = "*"
types-cachetools = "*"

12
src/Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "f316f6de355ca582eb3b6d06157714c1bd0cb9edfb03e9499889cd912fddd656" "sha256": "c26e60781d5da15edf636481c9a18506899f824283e8da44e0edf357d29a62cc"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": {}, "requires": {},
@ -830,9 +830,17 @@
"sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
"sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
], ],
"markers": "python_full_version < '3.11.0a7'", "markers": "python_version >= '3.7'",
"version": "==2.0.1" "version": "==2.0.1"
}, },
"types-cachetools": {
"hashes": [
"sha256:069cfc825697cd51445c1feabbe4edc1fae2b2315870e7a9a179a7c4a5851bee",
"sha256:b496b7e364ba050c4eaadcc6582f2c9fbb04f8ee7141eb3b311a8589dbd4506a"
],
"index": "pypi",
"version": "==5.2.1"
},
"types-pytz": { "types-pytz": {
"hashes": [ "hashes": [
"sha256:0c163b15d3e598e6cc7074a99ca9ec72b25dc1b446acc133b827667af0b7b09a", "sha256:0c163b15d3e598e6cc7074a99ca9ec72b25dc1b446acc133b827667af0b7b09a",

View file

@ -7,6 +7,7 @@ from django.test import TestCase, RequestFactory
from ..views import available, _domains, in_domains from ..views import available, _domains, in_domains
class AvailableViewTest(TestCase): class AvailableViewTest(TestCase):
"""Test that the view function works as expected.""" """Test that the view function works as expected."""

View file

@ -10,7 +10,9 @@ import requests
from cachetools.func import ttl_cache from cachetools.func import ttl_cache
DOMAIN_FILE_URL = "https://raw.githubusercontent.com/cisagov/dotgov-data/main/current-full.csv" DOMAIN_FILE_URL = (
"https://raw.githubusercontent.com/cisagov/dotgov-data/main/current-full.csv"
)
# this file doesn't change that often, nor is it that big, so cache the result # this file doesn't change that often, nor is it that big, so cache the result
@ -52,4 +54,3 @@ def available(request, domain=""):
""" """
# a domain is available if it is NOT in the list of current domains # a domain is available if it is NOT in the list of current domains
return JsonResponse({"available": not in_domains(domain)}) return JsonResponse({"available": not in_domains(domain)})