forked from rDrama/rDrama
dfdf
parent
65ddd59c93
commit
14648795aa
|
@ -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 *
|
|
@ -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
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue