diff --git a/config.py b/config.py index 21ae3ec..1f391fc 100644 --- a/config.py +++ b/config.py @@ -8,6 +8,8 @@ class Config(object): DEVELOPMENT = False SECRET_KEY = '97867c1491bea5ee6a8e8436eb11bf2ba6a69ff53ab1b17ecba450d0f2e572e1' + # WTF_CSRF_ENABLED = True + # flask-security-too settings SECURITY_PASSWORD_SALT = '228614859439123264035565568761433607235' REMEMBER_COOKIE_SAMESITE = 'strict' @@ -16,9 +18,7 @@ class Config(object): SECURITY_TRACKABLE = True SECURITY_PASSWORD_COMPLEXITY_CHECKER = 'zxcvbn' SECURITY_POST_LOGIN_VIEW = '/user/tenant' - SECURITY_REGISTERABLE = False - SECURITY_LOGINABLE = False - SECURITY_LOGOUTABLE = False + SECURITY_RECOVERABLE = True @@ -26,6 +26,9 @@ class Config(object): MAIL_SERVER = 'mail.flow-it.net' MAIL_PORT = 465 MAIL_USE_TLS = True + MAIL_USE_SSL = False + MAIL_DEFAULT_SENDER = 'eveAI Admin ' + class DevConfig(Config): @@ -36,8 +39,8 @@ class DevConfig(Config): EXPLAIN_TEMPLATE_LOADING = True # flask-mailman settings - MAIL_USERNAME = 'eveai_admin@flow-it.net' - MAIL_PASSWORD = 'FgV650K3ow#5FeBcZc5' + MAIL_USERNAME = 'eveai_super@flow-it.net' + MAIL_PASSWORD = '$6xsWGbNtx$CFMQZqc*' class ProdConfig(Config): diff --git a/eveai_app/__init__.py b/eveai_app/__init__.py index 2b214a7..65f9d97 100644 --- a/eveai_app/__init__.py +++ b/eveai_app/__init__.py @@ -1,3 +1,4 @@ +import logging import os from flask import Flask from flask_security import SQLAlchemyUserDatastore @@ -29,7 +30,9 @@ def create_app(config_file=None): register_blueprints(app) - print(app.config.get('SQLALCHEMY_DATABASE_URI')) + if app.config['DEBUG'] is True: + app.logger.setLevel(logging.DEBUG) + return app @@ -45,8 +48,6 @@ def register_extensions(app): def register_blueprints(app): from .views.user_views import user_bp app.register_blueprint(user_bp) - from .views.auth_views import auth_bp - app.register_blueprint(auth_bp) def register_api(app): diff --git a/eveai_app/models/user.py b/eveai_app/models/user.py index 12ff78e..8e50acd 100644 --- a/eveai_app/models/user.py +++ b/eveai_app/models/user.py @@ -76,7 +76,7 @@ class User(db.Model, UserMixin): login_count = db.Column(db.Integer, nullable=False, default=0) # Relations - roles = db.relationship('Role', secondary='public.roles_users', backref=db.backref('users', lazy='dynamic')) + roles = db.relationship('Role', secondary=RolesUsers.__table__, backref=db.backref('users', lazy='dynamic')) tenant_id = db.Column(db.Integer, db.ForeignKey('public.tenant.id'), nullable=False) def __repr__(self): diff --git a/eveai_app/static/assets/css/eveai.css b/eveai_app/static/assets/css/eveai.css new file mode 100644 index 0000000..e69de29 diff --git a/eveai_app/templates/base.html b/eveai_app/templates/base.html index 4a03a63..fe17e51 100644 --- a/eveai_app/templates/base.html +++ b/eveai_app/templates/base.html @@ -35,17 +35,36 @@
-
- -
- {% block content %}{% endblock %} +
+
+
+
+
+
+

+ {% block content_title %}{% endblock %} +

+

+ {% block content_description %}{% endblock %} +

+
+
+
+ {% block content %}{% endblock %} +
+ +
+
+
+
-
- -

@@ -56,6 +75,7 @@ - - + {% block scripts %} + {%- endblock scripts %} + \ No newline at end of file diff --git a/eveai_app/templates/header.html b/eveai_app/templates/header.html index b7e584f..f81b23e 100644 --- a/eveai_app/templates/header.html +++ b/eveai_app/templates/header.html @@ -1,5 +1,5 @@
-