diff --git a/mayan/apps/common/apps.py b/mayan/apps/common/apps.py index 08b8a5f454..cbd09140a2 100644 --- a/mayan/apps/common/apps.py +++ b/mayan/apps/common/apps.py @@ -23,7 +23,7 @@ from .links import ( from .menus import ( menu_facet, menu_main, menu_secondary, menu_setup, menu_tools ) -from .models import AnonymousUserSingleton, UserLocaleProfile +from .models import AnonymousUserSingleton from .settings import TEMPORARY_DIRECTORY from .utils import validate_path diff --git a/mayan/apps/common/classes.py b/mayan/apps/common/classes.py index 48a576efb1..17c6fec4a5 100644 --- a/mayan/apps/common/classes.py +++ b/mayan/apps/common/classes.py @@ -83,4 +83,3 @@ class MissingItem(object): self.description = description self.view = view self.__class__._registry.append(self) - diff --git a/mayan/apps/common/forms.py b/mayan/apps/common/forms.py index 376d51957e..e168b6bdf3 100644 --- a/mayan/apps/common/forms.py +++ b/mayan/apps/common/forms.py @@ -5,7 +5,6 @@ import os from django import forms from django.conf import settings -from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.db import models from django.utils.html import escape @@ -13,7 +12,7 @@ from django.utils.translation import ugettext_lazy as _ from .models import UserLocaleProfile from .utils import return_attrib -from .widgets import DetailSelectMultiple, EmailInput, PlainWidget +from .widgets import DetailSelectMultiple, PlainWidget class DetailForm(forms.ModelForm): diff --git a/mayan/apps/common/handlers.py b/mayan/apps/common/handlers.py index 84c576845a..798101c7d6 100644 --- a/mayan/apps/common/handlers.py +++ b/mayan/apps/common/handlers.py @@ -2,9 +2,7 @@ from __future__ import unicode_literals from django.conf import settings -from .models import ( - AnonymousUserSingleton, UserLocaleProfile -) +from .models import UserLocaleProfile def user_locale_profile_session_config(sender, request, user, **kwargs): diff --git a/mayan/apps/common/templatetags/project_tags.py b/mayan/apps/common/templatetags/project_tags.py index b7f2c87be5..b7eed36fb0 100644 --- a/mayan/apps/common/templatetags/project_tags.py +++ b/mayan/apps/common/templatetags/project_tags.py @@ -14,4 +14,3 @@ def project_name(): @register.simple_tag def project_version(): return mayan.__version__ - diff --git a/mayan/apps/common/templatetags/subtemplates_tags.py b/mayan/apps/common/templatetags/subtemplates_tags.py index f253c76ff0..3da020b044 100644 --- a/mayan/apps/common/templatetags/subtemplates_tags.py +++ b/mayan/apps/common/templatetags/subtemplates_tags.py @@ -16,4 +16,3 @@ def render_subtemplate(context, template_name, template_context): new_context = Context(context) new_context.update(Context(template_context)) return get_template(template_name).render(new_context) - diff --git a/mayan/apps/common/utils.py b/mayan/apps/common/utils.py index 41bbd5a131..50706d1239 100644 --- a/mayan/apps/common/utils.py +++ b/mayan/apps/common/utils.py @@ -11,8 +11,6 @@ from django.contrib.contenttypes.models import ContentType from django.utils.datastructures import MultiValueDict from django.utils.http import urlquote as django_urlquote from django.utils.http import urlencode as django_urlencode -from django.utils.importlib import import_module -from django.utils.translation import ugettext_lazy as _ logger = logging.getLogger(__name__) @@ -87,7 +85,6 @@ def get_descriptor(file_input, read=True): def get_object_name(obj): - ct_label = ContentType.objects.get_for_model(obj).name if isinstance(obj, User): label = obj.get_full_name() if obj.get_full_name() else obj else: diff --git a/mayan/apps/common/views.py b/mayan/apps/common/views.py index db03ad9570..935fd5fc75 100644 --- a/mayan/apps/common/views.py +++ b/mayan/apps/common/views.py @@ -5,12 +5,11 @@ from json import dumps, loads from django.conf import settings from django.contrib import messages from django.contrib.auth.models import User -from django.contrib.auth.views import login, password_change from django.contrib.contenttypes.models import ContentType -from django.core.exceptions import ImproperlyConfigured, PermissionDenied +from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse -from django.http import HttpResponseRedirect -from django.shortcuts import redirect, render_to_response +from django.http import Http404, HttpResponseRedirect +from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ @@ -20,7 +19,6 @@ from django.views.generic.edit import CreateView, DeleteView, UpdateView from django.views.generic.list import ListView from dynamic_search.classes import SearchModel -from permissions.models import Permission from .api import tools from .classes import MissingItem @@ -33,7 +31,6 @@ from .mixins import ( ExtraContextMixin, ObjectListPermissionFilterMixin, ObjectPermissionCheckMixin, RedirectionMixin, ViewPermissionCheckMixin ) -from .utils import return_attrib class AssignRemoveView(TemplateView): @@ -395,7 +392,7 @@ class ParentChildListView(ViewPermissionCheckMixin, ObjectPermissionCheckMixin, is_empty = len(self.object_list) == 0 if is_empty: raise Http404(_("Empty list and '%(class_name)s.allow_empty' is False.") - % {'class_name': self.__class__.__name__}) + % {'class_name': self.__class__.__name__}) context = self.get_context_data(object=self.object) return self.render_to_response(context) diff --git a/mayan/apps/common/widgets.py b/mayan/apps/common/widgets.py index 6d3ca56743..b89d01f0a0 100644 --- a/mayan/apps/common/widgets.py +++ b/mayan/apps/common/widgets.py @@ -98,23 +98,6 @@ class TextAreaDiv(forms.widgets.Widget): return mark_safe(result) -# From: http://www.peterbe.com/plog/emailinput-html5-django -class EmailInput(forms.widgets.Input): - """ - Class for a login form widget that accepts only well formated - email address - """ - input_type = 'email' - - def render(self, name, value, attrs=None): - if attrs is None: - attrs = {} - attrs.update(dict(autocorrect='off', - autocapitalize='off', - spellcheck='false')) - return super(EmailInput, self).render(name, value, attrs=attrs) - - class ScrollableCheckboxSelectMultiple(forms.widgets.CheckboxSelectMultiple): """ Class for a form widget composed of a selection of checkboxes wrapped