Jul 13 - Optimize code
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""User-submitted reports against listings (spam/abuse moderation)."""
|
||||
from datetime import datetime
|
||||
from app.utils.time import utcnow
|
||||
from app.extensions import db
|
||||
from app.models.enums import ReportReason
|
||||
|
||||
@@ -15,7 +16,7 @@ class Report(db.Model):
|
||||
db.ForeignKey("users.id"), nullable=False, index=True)
|
||||
reason = db.Column(db.Enum(ReportReason), nullable=False)
|
||||
note = db.Column(db.Text, nullable=True)
|
||||
created_at = db.Column(db.DateTime, default=datetime.utcnow, nullable=False)
|
||||
created_at = db.Column(db.DateTime, default=utcnow, nullable=False)
|
||||
|
||||
listing = db.relationship("Listing", backref=db.backref("reports", lazy="dynamic"))
|
||||
reporter = db.relationship("User", backref=db.backref("reports_filed", lazy="dynamic"))
|
||||
|
||||
Reference in New Issue
Block a user