mirror of
https://github.com/healthchecks/healthchecks.git
synced 2025-04-11 15:51:19 +00:00
Fix lint issues
This commit is contained in:
parent
a3965fcae5
commit
f6a04d2256
5 changed files with 9 additions and 17 deletions
hc
accounts
front
lib
|
@ -1,7 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta as td
|
||||
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth import login as auth_login
|
||||
from django.contrib.auth.admin import UserAdmin
|
||||
|
@ -12,7 +10,6 @@ from django.template.loader import render_to_string
|
|||
from django.urls import reverse
|
||||
from django.utils.html import escape
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.timezone import now
|
||||
|
||||
from hc.accounts.models import Credential, Profile, Project
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from importlib.util import find_spec
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
|
@ -10,16 +10,14 @@ class Command(BaseCommand):
|
|||
help = "Renders Markdown to HTML"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
try:
|
||||
import markdown
|
||||
for pkg in ("markdown", "pygments"):
|
||||
if find_spec(pkg) is None:
|
||||
self.stdout.write(f"This command requires the {pkg} package.")
|
||||
self.stdout.write("Please install it with:\n\n")
|
||||
self.stdout.write(f" pip install {pkg}\n\n")
|
||||
return
|
||||
|
||||
# We use pygments for highlighting code samples
|
||||
import pygments
|
||||
except ImportError as e:
|
||||
self.stdout.write(f"This command requires the {e.name} package.")
|
||||
self.stdout.write("Please install it with:\n\n")
|
||||
self.stdout.write(f" pip install {e.name}\n\n")
|
||||
return
|
||||
import markdown
|
||||
|
||||
extensions = [
|
||||
"fenced_code",
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from django.test.utils import override_settings
|
||||
|
||||
from hc.api.models import Channel, Check
|
||||
from hc.test import BaseTestCase
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class ServeDocTestCase(TestCase):
|
|||
|
||||
@patch("hc.front.views.settings.BASE_DIR")
|
||||
def test_it_rejects_bad_characters(self, mock_base_dir):
|
||||
r = self.client.get("/docs/NAUGHTY/")
|
||||
self.client.get("/docs/NAUGHTY/")
|
||||
# URL dispatcher's slug filter lets the uppercase letters through,
|
||||
# but the view should still reject them, before any filesystem
|
||||
# operations
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import time
|
||||
from io import BytesIO
|
||||
from threading import Thread
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue