sfd
This commit is contained in:
parent
a41b80c1f0
commit
155d56d012
3 changed files with 11 additions and 19 deletions
|
@ -481,12 +481,6 @@ class User(Base):
|
|||
if self.profileurl:
|
||||
if self.profileurl.startswith('/'): return SITE_FULL + self.profileurl
|
||||
return self.profileurl
|
||||
if SITE_NAME == 'Drama':
|
||||
self.profileurl = '/e/' + random.choice(marseys_const) + '.webp'
|
||||
try: g.db.add(self)
|
||||
except: pass
|
||||
g.db.commit()
|
||||
return self.profileurl
|
||||
return f"{SITE_FULL}/static/assets/images/default-profile-pic.webp?v=1008"
|
||||
|
||||
@lazy
|
||||
|
|
|
@ -46,18 +46,6 @@ def notif_comment(text, autojanny=False):
|
|||
|
||||
text_html = sanitize(text, alert=True)
|
||||
|
||||
try: existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none()
|
||||
except:
|
||||
existing = g.db.query(Comment).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).all()
|
||||
|
||||
|
||||
notifs = g.db.query(Notification).filter(Notification.comment_id.in_([x.id for x in existing])).all()
|
||||
for c in notifs: g.db.delete(c)
|
||||
g.db.flush()
|
||||
|
||||
|
||||
for c in existing: g.db.delete(c)
|
||||
g.db.flush()
|
||||
existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none()
|
||||
|
||||
if existing: return existing[0]
|
||||
|
|
|
@ -23,6 +23,16 @@ GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
|||
|
||||
month = datetime.now().strftime('%B')
|
||||
|
||||
@app.get('/admin/default')
|
||||
@admin_level_required(3)
|
||||
def default(v):
|
||||
for u in g.db.query(User).filter(User.profileurl == None).all():
|
||||
u.profileurl = '/e/' + random.choice(marseys_const) + '.webp'
|
||||
g.db.add(u)
|
||||
print(u.username, flush=True)
|
||||
g.db.commit()
|
||||
return 'done'
|
||||
|
||||
@app.get('/admin/merge/<id1>/<id2>')
|
||||
@admin_level_required(3)
|
||||
def merge(v, id1, id2):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue