gf
This commit is contained in:
parent
bc430e5c42
commit
4a8a6dde8c
11 changed files with 22 additions and 90 deletions
|
@ -610,22 +610,12 @@ class User(Base, Stndrd, Age_times):
|
|||
'ban_reason': self.ban_reason,
|
||||
'id': self.base36id
|
||||
}
|
||||
|
||||
elif self.deleted_utc:
|
||||
return {'username': self.username,
|
||||
'permalink': self.permalink,
|
||||
'deleted_utc': True,
|
||||
'id': self.base36id
|
||||
}
|
||||
return self.json_raw
|
||||
|
||||
@property
|
||||
def json(self):
|
||||
data = self.json_core
|
||||
|
||||
if self.deleted_utc > 0 or self.is_banned:
|
||||
return data
|
||||
|
||||
data["badges"] = [x.json_core for x in self.badges]
|
||||
data['dramacoins'] = int(self.dramacoins)
|
||||
data['post_count'] = self.post_count
|
||||
|
@ -637,20 +627,6 @@ class User(Base, Stndrd, Age_times):
|
|||
def can_use_darkmode(self):
|
||||
return True
|
||||
|
||||
# return self.referral_count or self.has_earned_darkmode or
|
||||
# self.has_badge(16) or self.has_badge(17)
|
||||
|
||||
@property
|
||||
def is_valid(self):
|
||||
if self.is_banned and self.unban_utc == 0:
|
||||
return False
|
||||
|
||||
elif self.deleted_utc:
|
||||
return False
|
||||
|
||||
else:
|
||||
return True
|
||||
|
||||
def ban(self, admin=None, reason=None, days=0):
|
||||
|
||||
if days > 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue