forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-09-17 14:41:04 +02:00
parent fe7e5c98c4
commit 2cd93e6516
1 changed files with 53 additions and 53 deletions

View File

@ -23,52 +23,52 @@ defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
cardview = bool(int(environ.get("CARD_VIEW", 1)))
if site_name == "Drama":
AWARDS = {
"ban": {
"kind": "ban",
"title": "One-Day Ban",
"description": "Bans the author for a day.",
"icon": "fas fa-gavel",
"color": "text-danger",
"price": 5000
},
"shit": {
"kind": "shit",
"title": "Shit",
"description": "Makes flies swarm a post.",
"icon": "fas fa-poop",
"color": "text-black-50",
"price": 1000
},
"stars": {
"kind": "stars",
"title": "Stars",
"description": "Puts stars on the post.",
"icon": "fas fa-sparkles",
"color": "text-warning",
"price": 1000
}
}
else:
AWARDS = {
"shit": {
"kind": "shit",
"title": "shit",
"description": "Makes flies swarm a post.",
"icon": "fas fa-poop",
"color": "text-black-50",
"price": 1000
},
"stars": {
"kind": "stars",
"title": "Stars",
"description": "Puts stars on the post.",
"icon": "fas fa-sparkles",
"color": "text-warning",
"price": 1000
}
}
# if site_name == "Drama":
# AWARDS = {
# "ban": {
# "kind": "ban",
# "title": "One-Day Ban",
# "description": "Bans the author for a day.",
# "icon": "fas fa-gavel",
# "color": "text-danger",
# "price": 5000
# },
# "shit": {
# "kind": "shit",
# "title": "Shit",
# "description": "Makes flies swarm a post.",
# "icon": "fas fa-poop",
# "color": "text-black-50",
# "price": 1000
# },
# "stars": {
# "kind": "stars",
# "title": "Stars",
# "description": "Puts stars on the post.",
# "icon": "fas fa-sparkles",
# "color": "text-warning",
# "price": 1000
# }
# }
# else:
# AWARDS = {
# "shit": {
# "kind": "shit",
# "title": "shit",
# "description": "Makes flies swarm a post.",
# "icon": "fas fa-poop",
# "color": "text-black-50",
# "price": 1000
# },
# "stars": {
# "kind": "stars",
# "title": "Stars",
# "description": "Puts stars on the post.",
# "icon": "fas fa-sparkles",
# "color": "text-warning",
# "price": 1000
# }
# }
class User(Base, Stndrd, Age_times):
__tablename__ = "users"
@ -180,16 +180,16 @@ class User(Base, Stndrd, Age_times):
super().__init__(**kwargs)
@property
@lazy
def user_awards(v):
# @property
# @lazy
# def user_awards(v):
return_value = list(AWARDS.values())
# return_value = list(AWARDS.values())
user_awards = v.awards
for val in return_value: val['owned'] = user_awards.filter_by(kind=val['kind'], submission_id=None, comment_id=None).count()
# user_awards = v.awards
# for val in return_value: val['owned'] = user_awards.filter_by(kind=val['kind'], submission_id=None, comment_id=None).count()
return jsonify(return_value)
# return jsonify(return_value)
@property
@lazy