bbb
This commit is contained in:
parent
b16c4a18d5
commit
01aa227dbe
2 changed files with 4 additions and 3 deletions
|
@ -522,13 +522,14 @@ class User(Base):
|
||||||
self.bannerurl = None
|
self.bannerurl = None
|
||||||
|
|
||||||
def ban(self, admin=None, reason=None, days=0):
|
def ban(self, admin=None, reason=None, days=0):
|
||||||
if days: self.unban_utc = int(time.time()) + (days * 86400)
|
if days:
|
||||||
|
self.unban_utc = int(time.time()) + (days * 86400)
|
||||||
|
g.db.add(self)
|
||||||
elif self.discord_id: remove_user(self)
|
elif self.discord_id: remove_user(self)
|
||||||
|
|
||||||
self.is_banned = admin.id if admin else AUTOJANNY_ID
|
self.is_banned = admin.id if admin else AUTOJANNY_ID
|
||||||
if reason: self.ban_reason = reason
|
if reason: self.ban_reason = reason
|
||||||
|
|
||||||
g.db.add(self)
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -436,7 +436,7 @@ def message2(v, username):
|
||||||
|
|
||||||
|
|
||||||
beams_client.publish_to_interests(
|
beams_client.publish_to_interests(
|
||||||
interests=[f'{request.host}{parent.author.id}'],
|
interests=[str(user.id)],
|
||||||
publish_body={
|
publish_body={
|
||||||
'web': {
|
'web': {
|
||||||
'notification': {
|
'notification': {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue