diff --git a/drama/classes/__init__.py b/drama/classes/__init__.py index 974be51ef5..8f73339804 100644 --- a/drama/classes/__init__.py +++ b/drama/classes/__init__.py @@ -12,6 +12,5 @@ from .images import * from .domains import * from .subscriptions import * from .agents import * -from .titles import * from .lolwtf import * from .mod_logs import * \ No newline at end of file diff --git a/drama/classes/titles.py b/drama/classes/titles.py deleted file mode 100644 index 4c2469cef3..0000000000 --- a/drama/classes/titles.py +++ /dev/null @@ -1,37 +0,0 @@ -from sqlalchemy import * -from flask import render_template -from drama.__main__ import Base - -class Title(Base): - - __tablename__ = "titles" - id = Column(Integer, primary_key=True) - is_before = Column(Boolean, default=True) - text = Column(String(64)) - qualification_expr = Column(String(256)) - requirement_string = Column(String(512)) - color = Column(String(6), default="888888") - kind = Column(Integer, default=1) - - background_color_1 = Column(String(6)) - background_color_2 = Column(String(6)) - gradient_angle = Column(Integer, default=0) - box_shadow_color = Column(String(32)) - text_shadow_color = Column(String(32)) - - def check_eligibility(self, v): - - return bool(eval(self.qualification_expr, {}, {"v": v})) - - @property - def rendered(self): - return render_template('title.html', t=self) - - @property - def json(self): - - return {'id': self.id, - 'text': self.text, - 'color': f'#{self.color}', - 'kind': self.kind - } diff --git a/drama/classes/user.py b/drama/classes/user.py index 2279a17d6a..5f5fcdd8b1 100644 --- a/drama/classes/user.py +++ b/drama/classes/user.py @@ -5,7 +5,6 @@ import pyotp from drama.helpers.discord import delete_role from drama.helpers.aws import * from .alts import Alt -from .titles import Title from .submission import SaveRelationship from .comment import Notification from .subscriptions import * @@ -77,7 +76,6 @@ class User(Base, Stndrd, Age_times): unban_utc = Column(Integer, default=None) ban_reason = Column(String, default="") login_nonce = Column(Integer, default=0) - title = relationship("Title", lazy="joined") reserved = Column(String(256)) dramacoins = Column(Integer, default=0) mfa_secret = deferred(Column(String(16))) @@ -528,7 +526,6 @@ class User(Base, Stndrd, Age_times): 'is_private': self.is_private, 'profile_url': self.profile_url, 'banner_url': self.banner_url, - 'title': self.title.json if self.title else None, 'bio': self.bio, 'bio_html': self.bio_html, 'flair': self.customtitle