diff --git a/ureport/admins/views.py b/ureport/admins/views.py index a07af17d4..d6cffca38 100644 --- a/ureport/admins/views.py +++ b/ureport/admins/views.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -from smartmin.views import SmartCRUDL, SmartUpdateView - from django import forms from django.utils.translation import gettext_lazy as _ from dash.orgs.models import Org from dash.orgs.views import OrgPermsMixin +from smartmin.views import SmartCRUDL, SmartUpdateView from ureport.admins import OrgCache, refresh_caches diff --git a/ureport/assets/models.py b/ureport/assets/models.py index 67b84c829..a185fe103 100644 --- a/ureport/assets/models.py +++ b/ureport/assets/models.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -from smartmin.models import SmartModel - from django.db import models from django.utils.translation import gettext_lazy as _ from dash.orgs.models import Org +from smartmin.models import SmartModel BANNER = "B" PATTERN = "P" diff --git a/ureport/assets/views.py b/ureport/assets/views.py index d1ec8f1db..b24ce0f37 100644 --- a/ureport/assets/views.py +++ b/ureport/assets/views.py @@ -1,11 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView - from django.db.models.functions import Lower from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView from ureport.assets.models import Image diff --git a/ureport/bots/models.py b/ureport/bots/models.py index bb59ea510..034564b68 100644 --- a/ureport/bots/models.py +++ b/ureport/bots/models.py @@ -1,9 +1,8 @@ -from smartmin.models import SmartModel - from django.db import models from django.utils.translation import gettext_lazy as _ from dash.orgs.models import Org +from smartmin.models import SmartModel class Bot(SmartModel): diff --git a/ureport/bots/views.py b/ureport/bots/views.py index 6436b4fee..3727d90f5 100644 --- a/ureport/bots/views.py +++ b/ureport/bots/views.py @@ -1,10 +1,9 @@ -from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView - from django import forms from django.db.models.functions import Lower from django.utils.translation import gettext_lazy as _ from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView from ureport.bots.models import Bot diff --git a/ureport/countries/models.py b/ureport/countries/models.py index 55e6a104f..0d785db5e 100644 --- a/ureport/countries/models.py +++ b/ureport/countries/models.py @@ -4,11 +4,12 @@ import regex import six from django_countries.fields import CountryField -from smartmin.models import SmartModel from django.db import models from django.utils.translation import gettext_lazy as _ +from smartmin.models import SmartModel + class CountryAlias(SmartModel): country = CountryField() diff --git a/ureport/countries/views.py b/ureport/countries/views.py index 40cc7b6c5..540e6858d 100644 --- a/ureport/countries/views.py +++ b/ureport/countries/views.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView - from django import forms +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView + from .models import CountryAlias diff --git a/ureport/jobs/models.py b/ureport/jobs/models.py index dee63a5b8..ded683580 100644 --- a/ureport/jobs/models.py +++ b/ureport/jobs/models.py @@ -5,7 +5,6 @@ import feedparser import six -from smartmin.models import SmartModel from django.conf import settings from django.core.cache import cache @@ -14,6 +13,7 @@ from django.utils.translation import gettext_lazy as _ from dash.orgs.models import Org +from smartmin.models import SmartModel RSS_JOBS_FEED_CACHE_TIME = getattr(settings, "RSS_JOBS_FEED_CACHE_TIME", 60 * 60 * 6) RSS_JOBS_KEY = "jobsource:%d:%d" diff --git a/ureport/jobs/views.py b/ureport/jobs/views.py index ea472e72b..df3ea850b 100644 --- a/ureport/jobs/views.py +++ b/ureport/jobs/views.py @@ -1,11 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView - from django.utils.translation import gettext_lazy as _ from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView from ureport.jobs.models import JobSource diff --git a/ureport/landingpages/models.py b/ureport/landingpages/models.py index 214b4ecf4..404d100d8 100644 --- a/ureport/landingpages/models.py +++ b/ureport/landingpages/models.py @@ -1,12 +1,11 @@ from functools import partial -from smartmin.models import SmartModel - from django.db import models from django.utils.translation import gettext_lazy as _ from dash.orgs.models import Org from dash.utils import generate_file_path +from smartmin.models import SmartModel from ureport.bots.models import Bot diff --git a/ureport/landingpages/views.py b/ureport/landingpages/views.py index 7e1c09301..002dd8ec4 100644 --- a/ureport/landingpages/views.py +++ b/ureport/landingpages/views.py @@ -1,5 +1,3 @@ -from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView - from django import forms from django.db.models.functions import Lower from django.urls import reverse @@ -7,6 +5,7 @@ from django.utils.translation import gettext_lazy as _ from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView from ureport.bots.models import Bot from ureport.landingpages.models import LandingPage diff --git a/ureport/news/models.py b/ureport/news/models.py index 69b1062b9..89c4b8eed 100644 --- a/ureport/news/models.py +++ b/ureport/news/models.py @@ -1,14 +1,13 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -from smartmin.models import SmartModel - from django.db import models from django.utils import formats from django.utils.translation import gettext_lazy as _ from dash.categories.models import Category from dash.orgs.models import Org +from smartmin.models import SmartModel class NewsItem(SmartModel): diff --git a/ureport/news/views.py b/ureport/news/views.py index 577f7835b..d19532aa0 100644 --- a/ureport/news/views.py +++ b/ureport/news/views.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView - from django import forms from dash.categories.fields import CategoryChoiceField from dash.categories.models import Category from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView from .models import NewsItem, Video diff --git a/ureport/polls/models.py b/ureport/polls/models.py index eeabc1457..55de63804 100644 --- a/ureport/polls/models.py +++ b/ureport/polls/models.py @@ -9,7 +9,6 @@ import six from django_redis import get_redis_connection -from smartmin.models import SmartModel from django.conf import settings from django.contrib.auth.models import User @@ -25,6 +24,7 @@ from dash.categories.models import Category, CategoryImage from dash.orgs.models import Org, OrgBackend from dash.tags.models import Tag +from smartmin.models import SmartModel from ureport.flows.models import FlowResult, FlowResultCategory logger = logging.getLogger(__name__) diff --git a/ureport/polls/views.py b/ureport/polls/views.py index c4f6f9475..4792fdb93 100644 --- a/ureport/polls/views.py +++ b/ureport/polls/views.py @@ -6,7 +6,6 @@ from datetime import timedelta from django_redis import get_redis_connection -from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView from django import forms from django.core.cache import cache @@ -26,6 +25,7 @@ from dash.orgs.models import OrgBackend from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin from dash.tags.models import Tag +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView from ureport.utils import json_date_to_datetime from .models import Poll, PollImage, PollQuestion, PollResponseCategory diff --git a/ureport/public/views.py b/ureport/public/views.py index b1cd152be..f6df82b43 100644 --- a/ureport/public/views.py +++ b/ureport/public/views.py @@ -11,7 +11,6 @@ import pycountry import six from django_redis import get_redis_connection -from smartmin.views import SmartReadView, SmartTemplateView from django.conf import settings from django.core.cache import cache @@ -30,6 +29,7 @@ from dash.orgs.models import Org, TaskState from dash.orgs.views import OrgObjPermsMixin from dash.stories.models import Story, StoryImage +from smartmin.views import SmartReadView, SmartTemplateView from ureport.assets.models import Image from ureport.bots.models import Bot from ureport.countries.models import CountryAlias diff --git a/ureport/tests.py b/ureport/tests.py index 8c0db684b..da63481a6 100644 --- a/ureport/tests.py +++ b/ureport/tests.py @@ -6,7 +6,6 @@ import zoneinfo from mock import Mock, patch -from smartmin.tests import SmartminTest from temba_client.v2 import TembaClient from temba_client.v2.types import ( Contact as TembaContact, @@ -29,6 +28,7 @@ from dash.orgs.models import Org from dash.test import DashTest from dash.utils import random_string +from smartmin.tests import SmartminTest from ureport.backend.rapidpro import RapidProBackend from ureport.flows.models import FlowResult, FlowResultCategory from ureport.jobs.models import JobSource