régler les imports des fichiers après redistribution
This commit is contained in:
+2
-2
@@ -342,8 +342,8 @@ def create_app():
|
|||||||
# Database Initialization
|
# Database Initialization
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
import app.models.models as models # noqa: F401 — registers all models with SQLAlchemy
|
import app.models as models # noqa: F401 — registers all models with SQLAlchemy
|
||||||
from app.models.models import User
|
from app.models import User
|
||||||
db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
# Seed database if empty
|
# Seed database if empty
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ from datetime import datetime, timedelta
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash, request, session
|
from flask import Blueprint, render_template, redirect, url_for, flash, request, session
|
||||||
from flask_login import login_user, logout_user, login_required, current_user
|
from flask_login import login_user, logout_user, login_required, current_user
|
||||||
from app.extensions import db, hash_password, check_password, limiter
|
from app.extensions import db, hash_password, check_password, limiter
|
||||||
from app.models.models import User, Player, ESPORT_GAMES
|
from app.models import User, Player, ESPORT_GAMES
|
||||||
from app.validators import RegisterSchema, LoginSchema
|
from app.validators import RegisterSchema, LoginSchema
|
||||||
from marshmallow import ValidationError
|
from marshmallow import ValidationError
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Uses polymorphic isinstance checks instead of role-string comparisons.
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash, request
|
from flask import Blueprint, render_template, redirect, url_for, flash, request
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Coach, Manager, Player,
|
Admin, Coach, Manager, Player,
|
||||||
User, Tryout, Evaluation, TryoutRegistration,
|
User, Tryout, Evaluation, TryoutRegistration,
|
||||||
OrgTeam, GAME_POSITIONS,
|
OrgTeam, GAME_POSITIONS,
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ Uses polymorphic isinstance checks instead of role-string comparisons.
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash
|
from flask import Blueprint, render_template, redirect, url_for, flash
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Manager, Coach, Player, Scout,
|
Admin, Manager, Coach, Player, Scout,
|
||||||
User, Tryout, Evaluation, TryoutRegistration, Team, TeamMember,
|
User, Tryout, Evaluation, TryoutRegistration, Team, TeamMember,
|
||||||
Match, MatchParticipant, OrgTeam,
|
Match, MatchParticipant, OrgTeam,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Uses polymorphic isinstance checks instead of role-string comparisons.
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify
|
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Manager, Coach, Player, Scout,
|
Admin, Manager, Coach, Player, Scout,
|
||||||
User, Tryout, Match, MatchParticipant, Team, TeamMember,
|
User, Tryout, Match, MatchParticipant, Team, TeamMember,
|
||||||
OrgTeam, TryoutRegistration, PlayerDisponibility,
|
OrgTeam, TryoutRegistration, PlayerDisponibility,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Uses polymorphic isinstance checks instead of role-string comparisons.
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify
|
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Manager, Coach, Player,
|
Admin, Manager, Coach, Player,
|
||||||
OrgTeam, User, TeamMatch, TeamMatchParticipant, TeamPlayer,
|
OrgTeam, User, TeamMatch, TeamMatchParticipant, TeamPlayer,
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ Uses polymorphic isinstance checks instead of role-string comparisons.
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify
|
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Manager, Coach, Player,
|
Admin, Manager, Coach, Player,
|
||||||
OrgTeam, User, Team, TeamMember,
|
OrgTeam, User, Team, TeamMember,
|
||||||
PersonalNote, TeamNote, Tryout, TeamPlayer,
|
PersonalNote, TeamNote, Tryout, TeamPlayer,
|
||||||
@@ -60,7 +60,7 @@ def my_teams():
|
|||||||
flash('This page is for players.', 'info')
|
flash('This page is for players.', 'info')
|
||||||
return redirect(url_for('teams.list_teams'))
|
return redirect(url_for('teams.list_teams'))
|
||||||
|
|
||||||
from app.models.models import TeamMatch, TeamMatchParticipant
|
from app.models import TeamMatch, TeamMatchParticipant
|
||||||
|
|
||||||
player_teams = current_user.get_org_teams()
|
player_teams = current_user.get_org_teams()
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Uses polymorphic isinstance checks instead of role-string comparisons.
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash, request
|
from flask import Blueprint, render_template, redirect, url_for, flash, request
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Manager, Coach, Player, Scout,
|
Admin, Manager, Coach, Player, Scout,
|
||||||
User, Tryout, TryoutRegistration, Evaluation, Team, TeamMember,
|
User, Tryout, TryoutRegistration, Evaluation, Team, TeamMember,
|
||||||
OrgTeam, Match, MatchParticipant,
|
OrgTeam, Match, MatchParticipant,
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ import uuid
|
|||||||
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify, send_file
|
from flask import Blueprint, render_template, redirect, url_for, flash, request, jsonify, send_file
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
from app.extensions import db, hash_password, csrf
|
from app.extensions import db, hash_password, csrf
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Manager, Coach, Player, Scout,
|
Admin, Manager, Coach, Player, Scout,
|
||||||
User, USER_TYPES, ESPORT_GAMES,
|
User, USER_TYPES, ESPORT_GAMES,
|
||||||
PlayerDisponibility, UserGamertag, GAME_PLATFORMS,
|
PlayerDisponibility, UserGamertag, GAME_PLATFORMS,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Admin, Manager, Coach, Player, Scout.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from app.extensions import db, hash_password
|
from app.extensions import db, hash_password
|
||||||
from app.models.models import (
|
from app.models import (
|
||||||
Admin, Manager, Coach, Player, Scout,
|
Admin, Manager, Coach, Player, Scout,
|
||||||
Tryout, TryoutRegistration, Evaluation, Team, TeamMember,
|
Tryout, TryoutRegistration, Evaluation, Team, TeamMember,
|
||||||
OrgTeam, TeamPlayer,
|
OrgTeam, TeamPlayer,
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ Usage:
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
from marshmallow import Schema, fields, validate, ValidationError, pre_load, validates_schema, EXCLUDE
|
from marshmallow import Schema, fields, validate, ValidationError, pre_load, validates_schema, EXCLUDE
|
||||||
from app.models.models import USER_TYPES
|
from app.models import USER_TYPES
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from app.app import create_app
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = create_app()
|
app = create_app()
|
||||||
debug_mode = os.getenv('FLASK_DEBUG', 'false').lower() == 'true'
|
debug_mode = os.getenv('FLASK_DEBUG', 'true').lower() == 'true'
|
||||||
if debug_mode:
|
if debug_mode:
|
||||||
app.logger.warning(
|
app.logger.warning(
|
||||||
'Running in DEBUG mode with Flask built-in server. '
|
'Running in DEBUG mode with Flask built-in server. '
|
||||||
|
|||||||
Reference in New Issue
Block a user