From 4bcd97c0039ca9962599a0ad80a69467f1688f7f Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 5 Nov 2019 16:22:36 +0100 Subject: [PATCH] Only use relative imports for functions in the same package. --- app/admin/forms.py | 2 +- app/admin/views.py | 8 ++++---- app/auth/forms.py | 2 +- app/auth/views.py | 6 +++--- app/corpora/views.py | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/admin/forms.py b/app/admin/forms.py index ea46a553..0bd755dc 100644 --- a/app/admin/forms.py +++ b/app/admin/forms.py @@ -1,8 +1,8 @@ +from app.models import Role, User from flask_wtf import FlaskForm from wtforms import (BooleanField, SelectField, StringField, SubmitField, ValidationError) from wtforms.validators import DataRequired, Email, Length, Regexp -from ..models import Role, User class EditProfileAdminForm(FlaskForm): diff --git a/app/admin/views.py b/app/admin/views.py index 3f992087..0cbdf6ff 100644 --- a/app/admin/views.py +++ b/app/admin/views.py @@ -1,12 +1,12 @@ +from app import db +from app.decorators import admin_required +from app.models import Role, User +from app.tables import AdminUserItem, AdminUserTable from app.utils import background_delete_user from flask import current_app, flash, redirect, render_template, url_for from flask_login import login_required from . import admin from .forms import EditProfileAdminForm -from .. import db -from ..decorators import admin_required -from ..models import Role, User -from ..tables import AdminUserTable, AdminUserItem import threading diff --git a/app/auth/forms.py b/app/auth/forms.py index 296ce811..2f03f1b1 100644 --- a/app/auth/forms.py +++ b/app/auth/forms.py @@ -1,8 +1,8 @@ +from app.models import User from flask_wtf import FlaskForm from wtforms import (BooleanField, PasswordField, StringField, SubmitField, ValidationError) from wtforms.validators import DataRequired, Email, EqualTo, Length, Regexp -from ..models import User class LoginForm(FlaskForm): diff --git a/app/auth/views.py b/app/auth/views.py index 0ef0b428..0b124a82 100644 --- a/app/auth/views.py +++ b/app/auth/views.py @@ -1,11 +1,11 @@ +from app import db +from app.email import send_email +from app.models import User from flask import flash, redirect, render_template, request, url_for from flask_login import current_user, login_required, login_user, logout_user from . import auth from .forms import (LoginForm, PasswordResetForm, PasswordResetRequestForm, RegistrationForm) -from .. import db -from ..email import send_email -from ..models import User @auth.route('/login', methods=['GET', 'POST']) diff --git a/app/corpora/views.py b/app/corpora/views.py index 20c18e5f..9f95fbbc 100644 --- a/app/corpora/views.py +++ b/app/corpora/views.py @@ -1,13 +1,13 @@ +from app import db +from app.models import Corpus, CorpusFile from app.utils import background_prepare_corpus_file from flask import (abort, current_app, flash, redirect, request, render_template, url_for, send_from_directory) from flask_login import current_user, login_required +from werkzeug.utils import secure_filename from . import corpora from .forms import (AddCorpusFileForm, AddCorpusForm, EditCorpusFileForm, QueryDownloadForm, QueryForm) -from .. import db -from ..models import Corpus, CorpusFile -from werkzeug.utils import secure_filename import os import threading import logging