1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

clean up / format / poetry (#1000)

* stub in poetry for pipenv

* re-add tester image

* add pre-commit / formatting

* fix ghactions

* revert test data whitespace, exclude tests/data

* revert ws

* decruft, rm tox/pipenv

* install dev packages for base image

* add lgtm config to force to py3
This commit is contained in:
Matt Griswold
2021-07-10 10:12:35 -05:00
committed by GitHub
parent c458173667
commit 5147028bee
260 changed files with 3356 additions and 2456 deletions

View File

@@ -1,10 +1,9 @@
import os
from django.core.cache import cache
from django.utils.translation import ugettext_lazy as _
from django.http import JsonResponse
from django.urls import reverse, resolve
from django.urls import resolve, reverse
from django.utils.translation import ugettext_lazy as _
from rest_framework.viewsets import ModelViewSet
from peeringdb_server import settings
@@ -23,18 +22,18 @@ def on(timeout=None):
def off():
""" turn maintenance mode off """
"""turn maintenance mode off"""
if active():
os.remove(settings.MAINTENANCE_MODE_LOCKFILE)
def active():
""" return True if maintenance mode is currently active """
"""return True if maintenance mode is currently active"""
return os.path.isfile(settings.MAINTENANCE_MODE_LOCKFILE)
def raise_if_active():
""" raise ActionBlocked exception if maintenance mode is active """
"""raise ActionBlocked exception if maintenance mode is active"""
if active():
raise ActionBlocked()