From a9f2d9a4c736511235140f362ab33eb7da0cda61 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Mon, 27 Feb 2017 11:14:26 +0100 Subject: Nettoyage des imports --- management/commands/sendmails.py | 8 +++----- management/commands/timetables.py | 9 +++------ templatetags/dt_week.py | 2 -- urls.py | 3 +-- views.py | 5 ----- 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/management/commands/sendmails.py b/management/commands/sendmails.py index b53d6f9..c7725b7 100644 --- a/management/commands/sendmails.py +++ b/management/commands/sendmails.py @@ -14,17 +14,15 @@ # with celcatsanitizer; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand from django.core.mail import send_mass_mail -from django.utils import timezone, translation +from django.utils import translation from django.template import Context, loader from django.conf import settings -from edt.models import Group, Subscription, Course +from edt.models import Course, Subscription from edt.utils import get_current_or_next_week, get_week, group_courses -import datetime - class Command(BaseCommand): help = "Sends emails to subscribed users" diff --git a/management/commands/timetables.py b/management/commands/timetables.py index 50256db..d39075d 100644 --- a/management/commands/timetables.py +++ b/management/commands/timetables.py @@ -14,17 +14,14 @@ # with celcatsanitizer; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand from django.db import transaction from django.utils import timezone -from edt.models import Timetable, LastUpdate, Group, Room, Course +from edt.models import Timetable, LastUpdate, Course -from bs4 import BeautifulSoup - -from ._private import delete_courses_in_week, get_events, get_weeks, get_xml, Week +from ._private import delete_courses_in_week, get_events, get_weeks, get_xml import datetime -import requests @transaction.atomic def process_timetable_week(timetable, year, week, soup, weeks_in_soup): diff --git a/templatetags/dt_week.py b/templatetags/dt_week.py index 97d9b8b..eae5523 100644 --- a/templatetags/dt_week.py +++ b/templatetags/dt_week.py @@ -16,8 +16,6 @@ from django import template -import datetime - register = template.Library() @register.filter diff --git a/urls.py b/urls.py index 38c33a0..5557612 100644 --- a/urls.py +++ b/urls.py @@ -14,8 +14,7 @@ # with celcatsanitizer; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from django.conf.urls import url, handler404 - +from django.conf.urls import url from . import views urlpatterns = [ diff --git a/views.py b/views.py index 651533a..22c08ac 100644 --- a/views.py +++ b/views.py @@ -14,10 +14,7 @@ # with celcatsanitizer; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -from django.http import HttpResponse, Http404 -from django.db.models import Count from django.shortcuts import get_object_or_404, redirect, render -from django.utils import timezone from django.core.mail import send_mail from django.conf import settings from django.template import Context, loader @@ -26,8 +23,6 @@ from .forms import SubscribeForm from .models import Timetable, LastUpdate, Group, Subscription, Course from .utils import get_current_week, get_week, group_courses -import datetime - def index(request): timetables = Timetable.objects.all().order_by("name") groups = Group.objects.filter(tp__isnull=False).order_by("name") -- cgit v1.2.1