Jul 13 - Optimize code
This commit is contained in:
@@ -8,6 +8,7 @@ Rules:
|
||||
for now sent inline — fast enough at low volume).
|
||||
"""
|
||||
from datetime import datetime
|
||||
from app.utils.time import utcnow
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from flask import current_app
|
||||
from app.extensions import db
|
||||
@@ -67,7 +68,7 @@ def send_message(conversation, sender, body: str) -> Message:
|
||||
body=body,
|
||||
)
|
||||
db.session.add(msg)
|
||||
conversation.last_message_at = datetime.utcnow()
|
||||
conversation.last_message_at = utcnow()
|
||||
db.session.commit()
|
||||
|
||||
if flagged:
|
||||
|
||||
Reference in New Issue
Block a user