diff --git a/files/assets/images/rDrama/banners/48.webp b/files/assets/images/rDrama/banners/48.webp deleted file mode 100644 index cbc47fc91..000000000 Binary files a/files/assets/images/rDrama/banners/48.webp and /dev/null differ diff --git a/files/classes/alts.py b/files/classes/alts.py index 1a0c11a3c..86936e319 100644 --- a/files/classes/alts.py +++ b/files/classes/alts.py @@ -8,11 +8,7 @@ class Alt(Base): user1 = Column(Integer, ForeignKey("users.id"), primary_key=True) user2 = Column(Integer, ForeignKey("users.id"), primary_key=True) is_manual = Column(Boolean, default=False) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): diff --git a/files/classes/award.py b/files/classes/award.py index 60b00664d..46d638ec1 100644 --- a/files/classes/award.py +++ b/files/classes/award.py @@ -16,16 +16,12 @@ class AwardRelationship(Base): kind = Column(String) awarded_utc = Column(Integer) granted = Column(Boolean) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", primaryjoin="AwardRelationship.user_id==User.id", back_populates="awards") post = relationship("Submission", primaryjoin="AwardRelationship.submission_id==Submission.id", back_populates="awards") comment = relationship("Comment", primaryjoin="AwardRelationship.comment_id==Comment.id", back_populates="awards") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" diff --git a/files/classes/badges.py b/files/classes/badges.py index 17e95fd65..923b0543d 100644 --- a/files/classes/badges.py +++ b/files/classes/badges.py @@ -11,11 +11,7 @@ class BadgeDef(Base): id = Column(Integer, primary_key=True, autoincrement=True) name = Column(String) description = Column(String) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" @@ -34,16 +30,11 @@ class Badge(Base): badge_id = Column(Integer, ForeignKey('badge_defs.id'), primary_key=True) description = Column(String) url = Column(String) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", back_populates="badges") badge = relationship("BadgeDef", primaryjoin="Badge.badge_id == BadgeDef.id") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: - kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" diff --git a/files/classes/casino_game.py b/files/classes/casino_game.py index e8fcdd72b..a9f1f95a6 100644 --- a/files/classes/casino_game.py +++ b/files/classes/casino_game.py @@ -8,7 +8,7 @@ class Casino_Game(Base): id = Column(Integer, primary_key=True) user_id = Column(Integer, ForeignKey("users.id")) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) active = Column(Boolean, default=True) currency = Column(String) wager = Column(Integer) @@ -16,10 +16,5 @@ class Casino_Game(Base): kind = Column(String) game_state = Column(JSON) - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: - kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" diff --git a/files/classes/clients.py b/files/classes/clients.py index 12d753d47..a05e85785 100644 --- a/files/classes/clients.py +++ b/files/classes/clients.py @@ -18,14 +18,10 @@ class OauthApp(Base): redirect_uri = Column(String) description = Column(String) author_id = Column(Integer, ForeignKey("users.id")) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) author = relationship("User", back_populates="apps") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -66,14 +62,10 @@ class ClientAuth(Base): user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) oauth_client = Column(Integer, ForeignKey("oauth_apps.id"), primary_key=True) access_token = Column(String) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User") application = relationship("OauthApp") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/comment.py b/files/classes/comment.py index 792379ec2..0b8f706bc 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -37,7 +37,7 @@ class Comment(Base): id = Column(Integer, primary_key=True) author_id = Column(Integer, ForeignKey("users.id")) parent_submission = Column(Integer, ForeignKey("submissions.id")) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) edited_utc = Column(Integer, default=0) is_banned = Column(Boolean, default=False) ghost = Column(Boolean, default=False) @@ -73,13 +73,7 @@ class Comment(Base): flags = relationship("CommentFlag", order_by="CommentFlag.created_utc") options = relationship("CommentOption", order_by="CommentOption.id") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: - kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): - return f"" @lazy diff --git a/files/classes/domains.py b/files/classes/domains.py index fb24316fe..254f6a276 100644 --- a/files/classes/domains.py +++ b/files/classes/domains.py @@ -7,11 +7,7 @@ class BannedDomain(Base): __tablename__ = "banneddomains" domain = Column(String, primary_key=True) reason = Column(String) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/exiles.py b/files/classes/exiles.py index 9330840d0..d29056cff 100644 --- a/files/classes/exiles.py +++ b/files/classes/exiles.py @@ -9,13 +9,9 @@ class Exile(Base): user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) sub = Column(String, ForeignKey("subs.name"), primary_key=True) exiler_id = Column(Integer, ForeignKey("users.id")) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) exiler = relationship("User", primaryjoin="User.id==Exile.exiler_id") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/flags.py b/files/classes/flags.py index 31c930a58..c8f6c94f4 100644 --- a/files/classes/flags.py +++ b/files/classes/flags.py @@ -13,14 +13,10 @@ class Flag(Base): post_id = Column(Integer, ForeignKey("submissions.id"), primary_key=True) user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) reason = Column(String) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", primaryjoin = "Flag.user_id == User.id", uselist = False) - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -36,14 +32,10 @@ class CommentFlag(Base): comment_id = Column(Integer, ForeignKey("comments.id"), primary_key=True) user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) reason = Column(String) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", primaryjoin = "CommentFlag.user_id == User.id", uselist = False) - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" diff --git a/files/classes/follows.py b/files/classes/follows.py index 05d4bc44e..90e5ff87d 100644 --- a/files/classes/follows.py +++ b/files/classes/follows.py @@ -7,14 +7,10 @@ class Follow(Base): __tablename__ = "follows" target_id = Column(Integer, ForeignKey("users.id"), primary_key=True) user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", uselist=False, primaryjoin="User.id==Follow.user_id", back_populates="following") target = relationship("User", uselist=False, primaryjoin="User.id==Follow.target_id", back_populates="followers") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/hats.py b/files/classes/hats.py index 32824b7c3..18a631b48 100644 --- a/files/classes/hats.py +++ b/files/classes/hats.py @@ -15,15 +15,11 @@ class HatDef(Base): author_id = Column(Integer, ForeignKey('users.id')) price = Column(Integer) submitter_id = Column(Integer, ForeignKey("users.id")) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) author = relationship("User", primaryjoin="HatDef.author_id == User.id", back_populates="designed_hats") submitter = relationship("User", primaryjoin="HatDef.submitter_id == User.id") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -42,15 +38,11 @@ class Hat(Base): user_id = Column(Integer, ForeignKey('users.id'), primary_key=True) hat_id = Column(Integer, ForeignKey('hat_defs.id'), primary_key=True) equipped = Column(Boolean, default=False) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) hat_def = relationship("HatDef") owners = relationship("User", back_populates="owned_hats") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" diff --git a/files/classes/lottery.py b/files/classes/lottery.py index 8ea2fe1d1..7f4164966 100644 --- a/files/classes/lottery.py +++ b/files/classes/lottery.py @@ -13,11 +13,7 @@ class Lottery(Base): prize = Column(Integer, default=0) tickets_sold = Column(Integer, default=0) winner_id = Column(Integer, ForeignKey("users.id")) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" diff --git a/files/classes/marsey.py b/files/classes/marsey.py index 8a60a12a9..4a627466d 100644 --- a/files/classes/marsey.py +++ b/files/classes/marsey.py @@ -10,11 +10,7 @@ class Marsey(Base): tags = Column(String) count = Column(Integer, default=0) submitter_id = Column(Integer, ForeignKey("users.id")) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/mod.py b/files/classes/mod.py index ff2c3b4ec..fa14882e1 100644 --- a/files/classes/mod.py +++ b/files/classes/mod.py @@ -9,11 +9,7 @@ class Mod(Base): __tablename__ = "mods" user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) sub = Column(String, ForeignKey("subs.name"), primary_key=True) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index def124b88..3ba681049 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -16,16 +16,12 @@ class ModAction(Base): target_submission_id = Column(Integer, ForeignKey("submissions.id")) target_comment_id = Column(Integer, ForeignKey("comments.id")) _note=Column(String) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", primaryjoin="User.id==ModAction.user_id") target_user = relationship("User", primaryjoin="User.id==ModAction.target_user_id") target_post = relationship("Submission") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" diff --git a/files/classes/notifications.py b/files/classes/notifications.py index 22b053767..67a322829 100644 --- a/files/classes/notifications.py +++ b/files/classes/notifications.py @@ -10,14 +10,10 @@ class Notification(Base): user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) comment_id = Column(Integer, ForeignKey("comments.id"), primary_key=True) read = Column(Boolean, default=False) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) comment = relationship("Comment") user = relationship("User") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/polls.py b/files/classes/polls.py index 1b90dba28..75a39e11d 100644 --- a/files/classes/polls.py +++ b/files/classes/polls.py @@ -12,15 +12,11 @@ class SubmissionOption(Base): submission_id = Column(Integer, ForeignKey("submissions.id")) body_html = Column(Text) exclusive = Column(Integer) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) votes = relationship("SubmissionOptionVote") post = relationship("Submission", back_populates="options") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -41,15 +37,11 @@ class SubmissionOptionVote(Base): option_id = Column(Integer, ForeignKey("submission_options.id"), primary_key=True) user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) submission_id = Column(Integer, ForeignKey("submissions.id")) user = relationship("User") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -62,15 +54,11 @@ class CommentOption(Base): comment_id = Column(Integer, ForeignKey("comments.id")) body_html = Column(Text) exclusive = Column(Integer) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) votes = relationship("CommentOptionVote") comment = relationship("Comment", back_populates="options") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -91,14 +79,10 @@ class CommentOptionVote(Base): option_id = Column(Integer, ForeignKey("comment_options.id"), primary_key=True) user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) comment_id = Column(Integer, ForeignKey("comments.id")) user = relationship("User") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/saves.py b/files/classes/saves.py index 85a11afa2..731ab7aa7 100644 --- a/files/classes/saves.py +++ b/files/classes/saves.py @@ -9,14 +9,10 @@ class SaveRelationship(Base): user_id=Column(Integer, ForeignKey("users.id"), primary_key=True) submission_id=Column(Integer, ForeignKey("submissions.id"), primary_key=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) post = relationship("Submission", uselist=False) - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -27,13 +23,9 @@ class CommentSaveRelationship(Base): user_id=Column(Integer, ForeignKey("users.id"), primary_key=True) comment_id=Column(Integer, ForeignKey("comments.id"), primary_key=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) comment = relationship("Comment", uselist=False) - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/sub.py b/files/classes/sub.py index 97f3a54ad..50c58ea63 100644 --- a/files/classes/sub.py +++ b/files/classes/sub.py @@ -22,15 +22,11 @@ class Sub(Base): marseyurl = Column(String) css = Column(String) stealth = Column(Boolean) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) blocks = relationship("SubBlock", primaryjoin="SubBlock.sub==Sub.name") followers = relationship("SubSubscription", primaryjoin="SubSubscription.sub==Sub.name") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return self.name diff --git a/files/classes/sub_block.py b/files/classes/sub_block.py index 6f8d38750..4137ad03b 100644 --- a/files/classes/sub_block.py +++ b/files/classes/sub_block.py @@ -6,11 +6,7 @@ class SubBlock(Base): __tablename__ = "sub_blocks" user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) sub = Column(String(20), ForeignKey("subs.name"), primary_key=True) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/sub_join.py b/files/classes/sub_join.py index b4ba7e23e..f7a37f395 100644 --- a/files/classes/sub_join.py +++ b/files/classes/sub_join.py @@ -6,11 +6,7 @@ class SubJoin(Base): __tablename__ = "sub_joins" user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) sub = Column(String(20), ForeignKey("subs.name"), primary_key=True) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/sub_subscription.py b/files/classes/sub_subscription.py index 4f289f145..6018c938a 100644 --- a/files/classes/sub_subscription.py +++ b/files/classes/sub_subscription.py @@ -6,11 +6,7 @@ class SubSubscription(Base): __tablename__ = "sub_subscriptions" user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) sub = Column(String(20), ForeignKey("subs.name"), primary_key=True) - created_utc = Column(Integer) - - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) + created_utc = Column(Integer, default=int(time.time())) def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/submission.py b/files/classes/submission.py index b6d7dcc9e..ec9b95a03 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -24,7 +24,7 @@ class Submission(Base): id = Column(Integer, primary_key=True) author_id = Column(Integer, ForeignKey("users.id")) edited_utc = Column(Integer, default=0) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) thumburl = Column(String) is_banned = Column(Boolean, default=False) bannedfor = Column(String) @@ -69,10 +69,6 @@ class Submission(Base): bump_utc = deferred(Column(Integer, server_default=FetchedValue())) - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" diff --git a/files/classes/subscriptions.py b/files/classes/subscriptions.py index dc2b9c27d..ce09d2fb5 100644 --- a/files/classes/subscriptions.py +++ b/files/classes/subscriptions.py @@ -7,14 +7,10 @@ class Subscription(Base): __tablename__ = "subscriptions" user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) submission_id = Column(Integer, ForeignKey("submissions.id"), primary_key=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", uselist=False) post = relationship("Submission", uselist=False) - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/user.py b/files/classes/user.py index d79cdb124..5ad020461 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -69,7 +69,7 @@ class User(Base): post_count = Column(Integer, default=0) comment_count = Column(Integer, default=0) received_award_count = Column(Integer, default=0) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) admin_level = Column(Integer, default=0) last_active = Column(Integer, default=0, nullable=False) coins_spent = Column(Integer, default=0) @@ -134,8 +134,8 @@ class User(Base): currently_held_lottery_tickets = Column(Integer, default=0) total_held_lottery_tickets = Column(Integer, default=0) total_lottery_winnings = Column(Integer, default=0) - last_viewed_post_notifs = Column(Integer, default=0) - last_viewed_log_notifs = Column(Integer, default=0) + last_viewed_post_notifs = Column(Integer, default=int(time.time())) + last_viewed_log_notifs = Column(Integer, default=int(time.time())) pronouns = Column(String, default='they/them') bite = Column(Integer) earlylife = Column(Integer) @@ -163,11 +163,6 @@ class User(Base): kwargs["passhash"] = self.hash_password(kwargs["password"]) kwargs.pop("password") - if "created_utc" not in kwargs: - kwargs["created_utc"] = int(time.time()) - kwargs["last_viewed_post_notifs"] = kwargs["created_utc"] - kwargs["last_viewed_log_notifs"] = kwargs["created_utc"] - super().__init__(**kwargs) @@ -640,7 +635,7 @@ class User(Base): @property @lazy def modaction_notifications_count(self): - if not self.admin_level: return 0 + if not self.admin_level or self.id == AEVANN_ID: return 0 return g.db.query(ModAction).filter( ModAction.created_utc > self.last_viewed_log_notifs, ModAction.user_id != self.id, @@ -754,8 +749,6 @@ class User(Base): def profile_url(self): if self.agendaposter: return f"{SITE_FULL}/assets/images/pfps/agendaposter/{random.randint(1, 57)}.webp?v=1" - if self.bite: - return f"{SITE_FULL}/e/marseyvampire.webp" if self.rainbow: return f"{SITE_FULL}/e/marseysalutepride.webp" if self.profileurl: diff --git a/files/classes/userblock.py b/files/classes/userblock.py index 2dd5bd3e4..70cc5923b 100644 --- a/files/classes/userblock.py +++ b/files/classes/userblock.py @@ -8,14 +8,10 @@ class UserBlock(Base): __tablename__ = "userblocks" user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) target_id = Column(Integer, ForeignKey("users.id"), primary_key=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User", primaryjoin="User.id==UserBlock.user_id", back_populates="blocking") target = relationship("User", primaryjoin="User.id==UserBlock.target_id", back_populates="blocked") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" \ No newline at end of file diff --git a/files/classes/views.py b/files/classes/views.py index b3007003d..56def6e78 100644 --- a/files/classes/views.py +++ b/files/classes/views.py @@ -10,16 +10,11 @@ class ViewerRelationship(Base): user_id = Column(Integer, ForeignKey('users.id'), primary_key=True) viewer_id = Column(Integer, ForeignKey('users.id'), primary_key=True) - last_view_utc = Column(Integer) - created_utc = Column(Integer) + last_view_utc = Column(Integer, default=int(time.time())) + created_utc = Column(Integer, default=int(time.time())) viewer = relationship("User", primaryjoin="ViewerRelationship.viewer_id == User.id") - def __init__(self, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - if 'last_view_utc' not in kwargs: kwargs['last_view_utc'] = int(time.time()) - super().__init__(**kwargs) - def __repr__(self): return f"" diff --git a/files/classes/votes.py b/files/classes/votes.py index 1f72b4f8d..fbe9e310b 100644 --- a/files/classes/votes.py +++ b/files/classes/votes.py @@ -14,14 +14,10 @@ class Vote(Base): vote_type = Column(Integer) app_id = Column(Integer, ForeignKey("oauth_apps.id")) real = Column(Boolean, default=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f"" @@ -44,14 +40,10 @@ class CommentVote(Base): vote_type = Column(Integer) app_id = Column(Integer, ForeignKey("oauth_apps.id")) real = Column(Boolean, default=True) - created_utc = Column(Integer) + created_utc = Column(Integer, default=int(time.time())) user = relationship("User") - def __init__(self, *args, **kwargs): - if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) - super().__init__(*args, **kwargs) - def __repr__(self): return f""