fix(qa): resolver diagnosticos estaticos, sincronizacion moodle y actualizar docs v3.6.4
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from typing import Any, TYPE_CHECKING
|
||||
from app import db
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
|
||||
class User(db.Model):
|
||||
__tablename__ = 'users'
|
||||
@@ -16,7 +16,7 @@ class User(db.Model):
|
||||
name = db.Column(db.String(100), nullable=False)
|
||||
role = db.Column(db.String(50), nullable=False)
|
||||
is_active = db.Column(db.Boolean, default=True, nullable=False)
|
||||
created_at = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
created_at = db.Column(db.DateTime, default=lambda: datetime.now(timezone.utc).replace(tzinfo=None))
|
||||
last_login = db.Column(db.DateTime)
|
||||
preferred_language = db.Column(db.String(10), default=None, nullable=True)
|
||||
theme_preference = db.Column(db.String(10), default='auto', nullable=False)
|
||||
@@ -146,7 +146,7 @@ class User(db.Model):
|
||||
|
||||
def update_last_login(self):
|
||||
"""Update last login timestamp"""
|
||||
self.last_login = datetime.utcnow()
|
||||
self.last_login = datetime.now(timezone.utc).replace(tzinfo=None)
|
||||
db.session.commit()
|
||||
|
||||
def to_dict(self):
|
||||
|
||||
Reference in New Issue
Block a user