fgd
This commit is contained in:
parent
19d1620fd6
commit
579aa7eef3
5 changed files with 13 additions and 12 deletions
|
@ -9,7 +9,7 @@ from files.helpers.const import *
|
||||||
|
|
||||||
class ModAction(Base):
|
class ModAction(Base):
|
||||||
__tablename__ = "modactions"
|
__tablename__ = "modactions"
|
||||||
id = Column(BigInteger, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
|
|
||||||
user_id = Column(Integer, ForeignKey("users.id"))
|
user_id = Column(Integer, ForeignKey("users.id"))
|
||||||
kind = Column(String)
|
kind = Column(String)
|
||||||
|
|
|
@ -18,10 +18,10 @@ from .votes import CommentVote
|
||||||
class Submission(Base):
|
class Submission(Base):
|
||||||
__tablename__ = "submissions"
|
__tablename__ = "submissions"
|
||||||
|
|
||||||
id = Column(BigInteger, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
author_id = Column(BigInteger, ForeignKey("users.id"))
|
author_id = Column(Integer, ForeignKey("users.id"))
|
||||||
edited_utc = Column(BigInteger, default=0)
|
edited_utc = Column(Integer, default=0)
|
||||||
created_utc = Column(BigInteger, default=0)
|
created_utc = Column(Integer, default=0)
|
||||||
thumburl = Column(String)
|
thumburl = Column(String)
|
||||||
is_banned = Column(Boolean, default=False)
|
is_banned = Column(Boolean, default=False)
|
||||||
bannedfor = Column(Boolean)
|
bannedfor = Column(Boolean)
|
||||||
|
|
|
@ -5,9 +5,9 @@ from files.__main__ import Base
|
||||||
|
|
||||||
class Subscription(Base):
|
class Subscription(Base):
|
||||||
__tablename__ = "subscriptions"
|
__tablename__ = "subscriptions"
|
||||||
id = Column(BigInteger, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
user_id = Column(BigInteger, ForeignKey("users.id"))
|
user_id = Column(Integer, ForeignKey("users.id"))
|
||||||
submission_id = Column(BigInteger, default=0)
|
submission_id = Column(Integer, default=0)
|
||||||
|
|
||||||
user = relationship("User", uselist=False, viewonly=True)
|
user = relationship("User", uselist=False, viewonly=True)
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ class Subscription(Base):
|
||||||
|
|
||||||
class Follow(Base):
|
class Follow(Base):
|
||||||
__tablename__ = "follows"
|
__tablename__ = "follows"
|
||||||
id = Column(BigInteger, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
user_id = Column(BigInteger, ForeignKey("users.id"))
|
user_id = Column(Integer, ForeignKey("users.id"))
|
||||||
target_id = Column(BigInteger, ForeignKey("users.id"))
|
target_id = Column(Integer, ForeignKey("users.id"))
|
||||||
|
|
||||||
user = relationship("User", uselist=False, primaryjoin="User.id==Follow.user_id", viewonly=True)
|
user = relationship("User", uselist=False, primaryjoin="User.id==Follow.user_id", viewonly=True)
|
||||||
target = relationship("User", primaryjoin="User.id==Follow.target_id", viewonly=True)
|
target = relationship("User", primaryjoin="User.id==Follow.target_id", viewonly=True)
|
||||||
|
|
|
@ -105,6 +105,7 @@ allowed_styles = ['color', 'background-color', 'font-weight', 'text-align']
|
||||||
def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
||||||
|
|
||||||
if sanitized.count(':') > 100: abort(418)
|
if sanitized.count(':') > 100: abort(418)
|
||||||
|
if sanitized.count('@') > 50: abort(418)
|
||||||
|
|
||||||
sanitized = markdown(sanitized)
|
sanitized = markdown(sanitized)
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ def error_413(e):
|
||||||
|
|
||||||
@app.errorhandler(418)
|
@app.errorhandler(418)
|
||||||
def error_418(e):
|
def error_418(e):
|
||||||
return {"error": "Too many emojis!"}, 418
|
return {"error": "Too many emojis or pings!"}, 418
|
||||||
|
|
||||||
@app.errorhandler(429)
|
@app.errorhandler(429)
|
||||||
def error_429(e):
|
def error_429(e):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue