diff --git a/hc/accounts/admin.py b/hc/accounts/admin.py index 17633675..1f87c4d3 100644 --- a/hc/accounts/admin.py +++ b/hc/accounts/admin.py @@ -1,9 +1,6 @@ from django.contrib import admin - -# Register your models here. from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User - from hc.api.models import Channel, Check diff --git a/hc/accounts/tests/test_login.py b/hc/accounts/tests/test_login.py index 40e335c3..3dadf58a 100644 --- a/hc/accounts/tests/test_login.py +++ b/hc/accounts/tests/test_login.py @@ -1,7 +1,6 @@ from django.contrib.auth.models import User from django.core import mail from django.test import TestCase - from hc.api.models import Check diff --git a/hc/accounts/urls.py b/hc/accounts/urls.py index 11759edc..679837c4 100644 --- a/hc/accounts/urls.py +++ b/hc/accounts/urls.py @@ -1,5 +1,4 @@ from django.conf.urls import url - from hc.accounts import views urlpatterns = [ diff --git a/hc/accounts/views.py b/hc/accounts/views.py index d3ddb321..3372956a 100644 --- a/hc/accounts/views.py +++ b/hc/accounts/views.py @@ -1,13 +1,13 @@ import uuid from django.conf import settings +from django.contrib.auth import login as auth_login +from django.contrib.auth import logout as auth_logout from django.contrib.auth import authenticate -from django.contrib.auth import login as auth_login, logout as auth_logout from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http import HttpResponseBadRequest from django.shortcuts import redirect, render - from hc.accounts.forms import EmailForm from hc.api.models import Channel, Check from hc.lib import emails diff --git a/hc/api/admin.py b/hc/api/admin.py index 198fb336..a26997f5 100644 --- a/hc/api/admin.py +++ b/hc/api/admin.py @@ -1,5 +1,4 @@ from django.contrib import admin - from hc.api.models import Channel, Check, Notification, Ping diff --git a/hc/api/decorators.py b/hc/api/decorators.py index f507d61e..6f737be9 100644 --- a/hc/api/decorators.py +++ b/hc/api/decorators.py @@ -1,6 +1,7 @@ +import uuid from functools import wraps + from django.http import HttpResponseBadRequest -import uuid def uuid_or_400(f): diff --git a/hc/api/models.py b/hc/api/models.py index 7e35b055..f43fd886 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -1,18 +1,17 @@ # coding: utf-8 -from datetime import timedelta as td import hashlib import json import uuid +from datetime import timedelta as td +import requests from django.conf import settings -from django.core.urlresolvers import reverse from django.contrib.auth.models import User +from django.core.urlresolvers import reverse from django.db import models from django.template.loader import render_to_string from django.utils import timezone -import requests - from hc.lib import emails STATUSES = ( diff --git a/hc/api/tests/test_email_webhook.py b/hc/api/tests/test_email_webhook.py index 8f7ae9bc..25cf5f7c 100644 --- a/hc/api/tests/test_email_webhook.py +++ b/hc/api/tests/test_email_webhook.py @@ -1,7 +1,6 @@ import json from django.test import TestCase - from hc.api.models import Check, Ping diff --git a/hc/api/tests/test_notify.py b/hc/api/tests/test_notify.py index e57078bd..38ad8be5 100644 --- a/hc/api/tests/test_notify.py +++ b/hc/api/tests/test_notify.py @@ -1,11 +1,10 @@ from django.contrib.auth.models import User from django.core import mail from django.test import TestCase +from hc.api.models import Channel, Check, Notification from mock import patch from requests.exceptions import ReadTimeout -from hc.api.models import Channel, Check, Notification - class NotifyTestCase(TestCase): diff --git a/hc/api/tests/test_ping.py b/hc/api/tests/test_ping.py index 23194888..8a885778 100644 --- a/hc/api/tests/test_ping.py +++ b/hc/api/tests/test_ping.py @@ -1,5 +1,4 @@ from django.test import Client, TestCase - from hc.api.models import Check, Ping diff --git a/hc/api/tests/test_sendalerts.py b/hc/api/tests/test_sendalerts.py index c9d8d364..46462c8f 100644 --- a/hc/api/tests/test_sendalerts.py +++ b/hc/api/tests/test_sendalerts.py @@ -1,11 +1,10 @@ from datetime import datetime -from mock import patch from django.contrib.auth.models import User from django.test import TestCase - -from hc.api.models import Check from hc.api.management.commands.sendalerts import handle_many +from hc.api.models import Check +from mock import patch class SendAlertsTestCase(TestCase): diff --git a/hc/api/tests/test_status.py b/hc/api/tests/test_status.py index 21292da6..d4290d25 100644 --- a/hc/api/tests/test_status.py +++ b/hc/api/tests/test_status.py @@ -1,5 +1,4 @@ from django.test import TestCase - from hc.api.models import Check diff --git a/hc/api/urls.py b/hc/api/urls.py index ab8c5842..75d37066 100644 --- a/hc/api/urls.py +++ b/hc/api/urls.py @@ -1,5 +1,4 @@ from django.conf.urls import url - from hc.api import views urlpatterns = [ diff --git a/hc/api/views.py b/hc/api/views.py index 8cde1dec..a4ba53d1 100644 --- a/hc/api/views.py +++ b/hc/api/views.py @@ -4,7 +4,6 @@ from django.contrib.humanize.templatetags.humanize import naturaltime from django.http import HttpResponse, HttpResponseBadRequest from django.utils import timezone from django.views.decorators.csrf import csrf_exempt - from hc.api.decorators import uuid_or_400 from hc.api.models import Check, Ping diff --git a/hc/front/forms.py b/hc/front/forms.py index b70de41f..328caeeb 100644 --- a/hc/front/forms.py +++ b/hc/front/forms.py @@ -1,5 +1,4 @@ from django import forms - from hc.api.models import Channel diff --git a/hc/front/tests/test_add_channel.py b/hc/front/tests/test_add_channel.py index 31d45c65..d77b1013 100644 --- a/hc/front/tests/test_add_channel.py +++ b/hc/front/tests/test_add_channel.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Channel diff --git a/hc/front/tests/test_add_check.py b/hc/front/tests/test_add_check.py index b0222a0e..81c8e188 100644 --- a/hc/front/tests/test_add_check.py +++ b/hc/front/tests/test_add_check.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Check diff --git a/hc/front/tests/test_channel_checks.py b/hc/front/tests/test_channel_checks.py index 1d450949..6e09d4d5 100644 --- a/hc/front/tests/test_channel_checks.py +++ b/hc/front/tests/test_channel_checks.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Channel diff --git a/hc/front/tests/test_log.py b/hc/front/tests/test_log.py index d0656ec1..78188add 100644 --- a/hc/front/tests/test_log.py +++ b/hc/front/tests/test_log.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Check diff --git a/hc/front/tests/test_my_checks.py b/hc/front/tests/test_my_checks.py index d42ee941..cfddb0d2 100644 --- a/hc/front/tests/test_my_checks.py +++ b/hc/front/tests/test_my_checks.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Check diff --git a/hc/front/tests/test_remove_channel.py b/hc/front/tests/test_remove_channel.py index 22b67bb4..524f1287 100644 --- a/hc/front/tests/test_remove_channel.py +++ b/hc/front/tests/test_remove_channel.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Channel diff --git a/hc/front/tests/test_remove_check.py b/hc/front/tests/test_remove_check.py index 6335d35d..73b0f5d1 100644 --- a/hc/front/tests/test_remove_check.py +++ b/hc/front/tests/test_remove_check.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Check diff --git a/hc/front/tests/test_update_channel.py b/hc/front/tests/test_update_channel.py index fcf1af59..40bfa01c 100644 --- a/hc/front/tests/test_update_channel.py +++ b/hc/front/tests/test_update_channel.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Channel, Check diff --git a/hc/front/tests/test_update_name.py b/hc/front/tests/test_update_name.py index 5f0713ae..0316f471 100644 --- a/hc/front/tests/test_update_name.py +++ b/hc/front/tests/test_update_name.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Check diff --git a/hc/front/tests/test_update_timeout.py b/hc/front/tests/test_update_timeout.py index 7eb24407..ddf8ed23 100644 --- a/hc/front/tests/test_update_timeout.py +++ b/hc/front/tests/test_update_timeout.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Check diff --git a/hc/front/tests/test_verify_email.py b/hc/front/tests/test_verify_email.py index 98ccd046..61961938 100644 --- a/hc/front/tests/test_verify_email.py +++ b/hc/front/tests/test_verify_email.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.test import TestCase - from hc.api.models import Channel diff --git a/hc/front/views.py b/hc/front/views.py index 804e0b13..f5dc41e5 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -5,7 +5,6 @@ from django.contrib.auth.decorators import login_required from django.http import HttpResponseBadRequest, HttpResponseForbidden from django.shortcuts import get_object_or_404, redirect, render from django.utils import timezone - from hc.api.decorators import uuid_or_400 from hc.api.models import Channel, Check, Ping from hc.front.forms import AddChannelForm, TimeoutForm