Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Resolve warning of TypeDecorator AwareDateTime() in chat_manager.py and file_manager.py #2271

Merged
merged 7 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def generate_initial_config():

SQLALCHEMY_DB_URI = 'sqlite:///' + urljoin(DATA_DIR, 'mscolab.db')

# enable SQLALCHEMY_ECHO
SQLALCHEMY_ECHO = True

# mscolab file upload settings
UPLOAD_FOLDER = fs.path.join(DATA_DIR, 'uploads')
MAX_UPLOAD_SIZE = 2 * 1024 * 1024 # 2MB
Expand Down
3 changes: 3 additions & 0 deletions docs/samples/config/mscolab/mscolab_settings.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ GROUP_POSTFIX = "Group"
# SQLite: "sqlite:///<path_to_db>"
SQLALCHEMY_DB_URI = 'sqlite:///' + os.path.join(DATA_DIR, 'mscolab.db')

# Set to True for testing and False for production
SQLALCHEMY_ECHO = False

enable_basic_http_authentication = False

# text to be written in new mscolab based ftml files.
Expand Down
1 change: 1 addition & 0 deletions mslib/mscolab/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
APP.config['MSCOLAB_DATA_DIR'] = mscolab_settings.MSCOLAB_DATA_DIR
APP.config['SQLALCHEMY_DATABASE_URI'] = mscolab_settings.SQLALCHEMY_DB_URI
APP.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
APP.config['SQLALCHEMY_ECHO'] = mscolab_settings.SQLALCHEMY_ECHO
APP.config['UPLOAD_FOLDER'] = mscolab_settings.UPLOAD_FOLDER
APP.config['MAX_CONTENT_LENGTH'] = mscolab_settings.MAX_UPLOAD_SIZE
APP.config['SECRET_KEY'] = mscolab_settings.SECRET_KEY
Expand Down
3 changes: 3 additions & 0 deletions mslib/mscolab/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class default_mscolab_settings:
# MYSQL CONNECTION STRING: "mysql+pymysql://<username>:<password>@<host>:<port>/<db_name>?charset=utf8mb4"
SQLALCHEMY_DB_URI = 'sqlite:///' + os.path.join(DATA_DIR, 'mscolab.db')

# Set to True for testing and False for production
SQLALCHEMY_ECHO = False

# mscolab file upload settings
UPLOAD_FOLDER = os.path.join(DATA_DIR, 'uploads')
MAX_UPLOAD_SIZE = 2 * 1024 * 1024 # 2MB
Expand Down
1 change: 1 addition & 0 deletions mslib/mscolab/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

class AwareDateTime(sqlalchemy.types.TypeDecorator):
impl = sqlalchemy.types.DateTime
cache_ok = True

def process_bind_param(self, value, dialect):
if value is not None:
Expand Down