Commit b020644b authored by Simon Hanna's avatar Simon Hanna

Fix imports

parent 585bf154
......@@ -15,12 +15,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Postorius. If not, see <http://www.gnu.org/licenses/>.
try:
import setuptools
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
......
......@@ -18,13 +18,10 @@
"""Postorius view decorators."""
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth import authenticate, login
from django.core.exceptions import PermissionDenied
from postorius.models import (Domain, List, Member, MailmanUser,
MailmanApiError, Mailman404Error)
from .utils import set_user_access_props
from postorius.auth.utils import set_user_access_props
def basic_auth_login(fn):
......
......@@ -19,7 +19,6 @@
from django.forms import Form
from django.utils import safestring
from django.forms.forms import BoundField
from django.forms.utils import ErrorList
class FieldsetError(Exception):
......
......@@ -23,7 +23,6 @@ from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from postorius.fieldset_forms import FieldsetForm
from postorius.models import AddressConfirmationProfile
from postorius import utils
try:
......
......@@ -16,10 +16,8 @@
# You should have received a copy of the GNU General Public License along with
# Postorius. If not, see <http://www.gnu.org/licenses/>.
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import BaseCommand
from postorius import utils
from urllib2 import HTTPError
class Command(BaseCommand):
help = """Opens a Python shell with a mailmanclient object named `client`.
......
......@@ -19,7 +19,6 @@ from __future__ import (
absolute_import, division, print_function, unicode_literals)
import random
import uuid
import logging
......@@ -33,7 +32,6 @@ from django.core.urlresolvers import reverse
from django.dispatch import receiver
from django.db import models
from django.http import Http404
from django.template import Context
from django.template.loader import render_to_string
from mailmanclient import MailmanConnectionError
from postorius.utils import get_client
......
......@@ -16,7 +16,6 @@
# You should have received a copy of the GNU General Public License along with
# Postorius. If not, see <http://www.gnu.org/licenses/>.
from django.core.urlresolvers import reverse
from django import template
......
......@@ -16,7 +16,6 @@
# You should have received a copy of the GNU General Public License along with
# Postorius. If not, see <http://www.gnu.org/licenses/>.
from django.core.urlresolvers import reverse
from django import template
......
......@@ -17,7 +17,6 @@
# Postorius. If not, see <http://www.gnu.org/licenses/>.
from django import template
from django.core.urlresolvers import reverse
from django.utils.html import conditional_escape
......
......@@ -17,11 +17,8 @@
from __future__ import absolute_import, print_function, unicode_literals
import time
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.shortcuts import resolve_url
try:
from urllib2 import HTTPError
......
......@@ -19,14 +19,8 @@
from __future__ import absolute_import, print_function, unicode_literals
import mock
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from postorius.tests.utils import ViewTestCase
......
......@@ -21,11 +21,7 @@ from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.timezone import now
from six.moves.urllib_error import HTTPError
from six.moves.urllib_parse import quote
from postorius.models import MailmanUser, Mailman404Error, List
from postorius.tests.utils import ViewTestCase
......
......@@ -18,10 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
from django.core.urlresolvers import reverse
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from postorius.tests.utils import ViewTestCase
......
......@@ -19,11 +19,7 @@ from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.timezone import now
from six.moves.urllib_error import HTTPError
from six.moves.urllib_parse import quote
from postorius.models import MailmanUser, Mailman404Error
from postorius.tests.utils import ViewTestCase
......
......@@ -17,16 +17,8 @@
from __future__ import absolute_import, print_function, unicode_literals
import time
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.shortcuts import resolve_url
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from postorius.tests.utils import ViewTestCase
......
......@@ -21,12 +21,9 @@ from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.timezone import now
from six.moves.urllib_error import HTTPError
from six.moves.urllib_parse import quote
from postorius.views.list import SETTINGS_FORMS
from postorius.models import MailmanUser, Mailman404Error, List
from postorius.models import List
from postorius.tests.utils import ViewTestCase
......
......@@ -19,11 +19,6 @@ from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import IntegrityError
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from postorius.tests.utils import ViewTestCase
......
......@@ -18,8 +18,6 @@
from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import IntegrityError
try:
from urllib2 import HTTPError
except ImportError:
......
......@@ -21,10 +21,6 @@ from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from mock import patch
from smtplib import SMTPException
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from postorius.models import AddressConfirmationProfile
from postorius.tests.utils import ViewTestCase
......
......@@ -19,10 +19,6 @@ from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from postorius.tests.utils import ViewTestCase
......
......@@ -21,7 +21,6 @@ from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from mock import patch
from six.moves.urllib_parse import quote
from postorius.models import MailmanUser, Mailman404Error
from postorius.tests.utils import ViewTestCase
......
......@@ -22,10 +22,7 @@ from django.test import TestCase
from mock import patch
from postorius.auth.decorators import (list_owner_required,
list_moderator_required,
basic_auth_login)
from postorius.models import (Domain, List, Member, MailmanUser,
MailmanApiError, Mailman404Error)
list_moderator_required)
from mailmanclient import Client
......@@ -43,7 +40,6 @@ class ListOwnerRequiredTest(TestCase):
"""Tests the list_owner_required auth decorator."""
def setUp(self):
from django.test.client import RequestFactory
from postorius.tests.utils import create_mock_list
self.request_factory = RequestFactory()
# create a mock list with members
......@@ -109,7 +105,6 @@ class ListModeratorRequiredTest(TestCase):
"""Tests the list_owner_required auth decorator."""
def setUp(self):
from django.test.client import RequestFactory
from postorius.tests.utils import create_mock_list
self.request_factory = RequestFactory()
# create a mock list with members
......
......@@ -17,12 +17,11 @@
import logging
from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.test import RequestFactory, TestCase
from mock import patch, MagicMock
from mock import MagicMock
from six.moves.urllib_parse import quote
from postorius.utils import get_client
......
......@@ -20,7 +20,6 @@ import logging
from django.conf import settings
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render
from django.template import RequestContext
from mailmanclient import Client
from django.utils.translation import gettext as _
......
......@@ -21,13 +21,13 @@ from django.contrib import messages
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.urlresolvers import reverse
from django.shortcuts import render, redirect
from django.template import RequestContext
from django.utils.translation import gettext as _
try:
from urllib2 import HTTPError
except ImportError:
from urllib.error import HTTPError
from postorius import utils
from postorius.models import Domain
from postorius.forms import *
from postorius.auth.decorators import *
......
......@@ -39,6 +39,7 @@ except ImportError:
from postorius import utils
from postorius.forms import *
from postorius.models import Domain, List, MailmanApiError
from postorius.auth.decorators import *
from postorius.views.generic import MailingListView
......
......@@ -21,13 +21,10 @@ import logging
from django.forms.formsets import formset_factory
from django.contrib import messages
from django.contrib.auth.decorators import (login_required,user_passes_test)
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
from django.template import RequestContext
from django.utils.decorators import method_decorator
from django.utils.translation import gettext as _
from django.views.generic import TemplateView
from django.http import Http404
try:
......@@ -36,7 +33,8 @@ except ImportError:
from urllib.error import HTTPError
from postorius import utils
from postorius.models import MailmanConnectionError, AddressConfirmationProfile
from postorius.models import (MailmanConnectionError, MailmanApiError, List,
AddressConfirmationProfile, MailmanUser)
from postorius.forms import *
from postorius.auth.decorators import *
from postorius.views.generic import MailmanUserView
......@@ -44,7 +42,6 @@ from smtplib import SMTPException
from socket import error as socket_error
import errno
import uuid
import datetime
logger = logging.getLogger(__name__)
......@@ -258,7 +255,7 @@ def user_profile(request, user_email=None):
else:
form = AddressActivationForm(initial={'user_email': request.user.email})
return render(request, 'postorius/user/profile.html',
{'mm_user': mm_user, 'form': form}, context_instance=RequestContext(request))
{'mm_user': mm_user, 'form': form})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment