fix worker boot failure
parent
3506ee0c04
commit
e1b066de5d
|
@ -5,7 +5,7 @@ from sqlalchemy.orm import relationship
|
|||
from sqlalchemy.sql.sqltypes import *
|
||||
|
||||
from files.classes import Base
|
||||
from files.helpers.config.const import AWARDS, HOUSE_AWARDS
|
||||
from files.helpers.config.awards import AWARDS, HOUSE_AWARDS
|
||||
from files.helpers.lazy import lazy
|
||||
|
||||
|
||||
|
|
|
@ -6,13 +6,14 @@ import pyotp
|
|||
from sqlalchemy import Column, ForeignKey
|
||||
from sqlalchemy.orm import aliased, deferred
|
||||
from sqlalchemy.sql import func
|
||||
from sqlalchemy.sql.expression import not_, and_, or_, ColumnOperators
|
||||
from sqlalchemy.sql.expression import not_, and_, or_
|
||||
from sqlalchemy.sql.sqltypes import *
|
||||
|
||||
from files.classes import Base
|
||||
from files.classes.casino_game import Casino_Game
|
||||
from files.classes.sub import Sub
|
||||
from files.helpers.config.const import *
|
||||
from files.helpers.config.awards import AWARDS_ENABLED
|
||||
from files.helpers.media import *
|
||||
from files.helpers.security import *
|
||||
from files.helpers.sorting_and_time import *
|
||||
|
@ -421,7 +422,7 @@ class User(Base):
|
|||
@property
|
||||
@lazy
|
||||
def user_awards(self):
|
||||
return_value = list(AWARDS2.values())
|
||||
return_value = list(AWARDS_ENABLED.values())
|
||||
|
||||
if self.house:
|
||||
return_value.append(HOUSE_AWARDS[self.house])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from sqlalchemy import inspect
|
||||
|
||||
from files.helpers.config.const import AWARDS2, AWARDS_DISABLED
|
||||
from files.helpers.config.awards import AWARDS_ENABLED, AWARDS_DISABLED
|
||||
from files.__main__ import engine
|
||||
|
||||
from files.events.classes import *
|
||||
|
@ -13,10 +13,10 @@ def _build_table():
|
|||
EventUser.__table__.create(bind=engine, checkfirst=True)
|
||||
|
||||
def _populate_awards():
|
||||
temp = {x: AWARDS2[x] for x in AWARDS2 if x not in EVENT_AWARDS}
|
||||
AWARDS2.clear()
|
||||
AWARDS2.update(EVENT_AWARDS)
|
||||
AWARDS2.update(temp)
|
||||
temp = {x: AWARDS_ENABLED[x] for x in AWARDS_ENABLED if x not in EVENT_AWARDS}
|
||||
AWARDS_ENABLED.clear()
|
||||
AWARDS_ENABLED.update(EVENT_AWARDS)
|
||||
AWARDS_ENABLED.update(temp)
|
||||
|
||||
for award in EVENT_AWARDS:
|
||||
if award in AWARDS_DISABLED:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from copy import deepcopy
|
||||
|
||||
from files.helpers.config.const import FEATURES, SITE_NAME, patron
|
||||
|
||||
AWARDS = {
|
||||
"fallback": {
|
||||
|
@ -727,3 +728,18 @@ for k, val in temp:
|
|||
HOUSE_AWARDS[f'{k} Founder'] = val
|
||||
HOUSE_AWARDS[f'{k} Founder']['kind'] += ' Founder'
|
||||
HOUSE_AWARDS[f'{k} Founder']['price'] = int(HOUSE_AWARDS[f'{k} Founder']['price'] * 0.75)
|
||||
|
||||
if SITE_NAME != 'rDrama':
|
||||
AWARDS_DISABLED.append('progressivestack')
|
||||
|
||||
if SITE_NAME == 'PCM':
|
||||
# Previous set of disabled, changed temporarily by request 2022-10-17
|
||||
#AWARDS_DISABLED.extend(['ban','pizzashill','marsey','bird','grass','chud','unblockable'])
|
||||
AWARDS_DISABLED.extend(['unblockable'])
|
||||
AWARDS_DISABLED.remove('ghost')
|
||||
elif SITE_NAME == 'WPD':
|
||||
AWARDS_DISABLED.remove('lootbox')
|
||||
if not FEATURES['MARSEYBUX']:
|
||||
AWARDS_DISABLED.append('benefactor')
|
||||
|
||||
AWARDS_ENABLED = {x: AWARDS[x] for x in AWARDS if x not in AWARDS_DISABLED}
|
||||
|
|
|
@ -206,6 +206,7 @@ PAGE_SIZES = (10, 25, 50, 100)
|
|||
################################################################################
|
||||
### COLUMN INFO
|
||||
################################################################################
|
||||
|
||||
SUB_NAME_COLUMN_LENGTH = 25
|
||||
SUB_SIDEBAR_COLUMN_LENGTH = 10000
|
||||
SUB_SIDEBAR_HTML_COLUMN_LENGTH = 20000
|
||||
|
@ -702,6 +703,10 @@ else: # localhost or testing environment implied
|
|||
FEATURES['STREAMERS'] = True
|
||||
SUB_BANNER_LIMIT = 69420
|
||||
|
||||
patron = "Patron"
|
||||
if SITE_NAME == 'rDrama':
|
||||
patron = "Paypig"
|
||||
|
||||
HOUSES = ("None","Furry","Femboy","Vampire","Racist") if FEATURES['HOUSES'] else ("None")
|
||||
|
||||
bots = {AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID, BASEDBOT_ID}
|
||||
|
@ -710,28 +715,10 @@ COLORS = {'ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000
|
|||
|
||||
BAN_EVASION_DOMAIN = 'stupidpol.site'
|
||||
|
||||
### AWARDS
|
||||
|
||||
from files.helpers.config.awards import *
|
||||
if SITE_NAME != 'rDrama':
|
||||
AWARDS_DISABLED.append('progressivestack')
|
||||
|
||||
if SITE_NAME == 'PCM':
|
||||
# Previous set of disabled, changed temporarily by request 2022-10-17
|
||||
#AWARDS_DISABLED.extend(['ban','pizzashill','marsey','bird','grass','chud','unblockable'])
|
||||
AWARDS_DISABLED.extend(['unblockable'])
|
||||
AWARDS_DISABLED.remove('ghost')
|
||||
elif SITE_NAME == 'WPD':
|
||||
AWARDS_DISABLED.remove('lootbox')
|
||||
if not FEATURES['MARSEYBUX']:
|
||||
AWARDS_DISABLED.append('benefactor')
|
||||
|
||||
AWARDS2 = {x: AWARDS[x] for x in AWARDS if x not in AWARDS_DISABLED}
|
||||
|
||||
### END AWARDS
|
||||
|
||||
DOUBLE_XP_ENABLED = -1 # set to unixtime for when DXP begins, -1 to disable
|
||||
|
||||
### COMMENT NOTIFICATIONS ###
|
||||
|
||||
NOTIFIED_USERS = {
|
||||
'aevan': AEVANN_ID,
|
||||
'avean': AEVANN_ID,
|
||||
|
@ -797,6 +784,8 @@ if SITE == 'rdrama.net':
|
|||
elif SITE_NAME == 'WPD':
|
||||
REDDIT_NOTIFS_SITE.update({'watchpeopledie', 'makemycoffin'})
|
||||
|
||||
### END COMMENT NOTIFICATIONS ###
|
||||
|
||||
discounts = {
|
||||
# Big Spender badges, 2pp additive discount each
|
||||
69: 0.02,
|
||||
|
@ -934,9 +923,7 @@ forced_hats = {
|
|||
|
||||
EMAIL_REGEX_PATTERN = '[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{2,63}\.[A-Za-z]{2,63}'
|
||||
|
||||
patron = "Patron"
|
||||
if SITE_NAME == 'rDrama':
|
||||
patron = "Paypig"
|
||||
BOOSTED_SITES = {
|
||||
'rdrama.net',
|
||||
BAN_EVASION_DOMAIN,
|
||||
|
|
|
@ -8,6 +8,7 @@ from files.classes.userblock import UserBlock
|
|||
from files.helpers.actions import *
|
||||
from files.helpers.alerts import *
|
||||
from files.helpers.config.const import *
|
||||
from files.helpers.config.awards import AWARDS_ENABLED, HOUSE_AWARDS
|
||||
from files.helpers.get import *
|
||||
from files.helpers.marsify import marsify
|
||||
from files.helpers.owoify import owoify
|
||||
|
@ -23,7 +24,7 @@ from .front import frontlist
|
|||
@app.get("/settings/shop")
|
||||
@auth_required
|
||||
def shop(v:User):
|
||||
AWARDS = deepcopy(AWARDS2)
|
||||
AWARDS = deepcopy(AWARDS_ENABLED)
|
||||
|
||||
if v.house:
|
||||
AWARDS[v.house] = deepcopy(HOUSE_AWARDS[v.house])
|
||||
|
@ -53,7 +54,7 @@ def buy(v:User, award):
|
|||
if award == 'ghost' and v.admin_level < PERMS['BUY_GHOST_AWARD']:
|
||||
abort(403, "Only admins can buy this award")
|
||||
|
||||
AWARDS = deepcopy(AWARDS2)
|
||||
AWARDS = deepcopy(AWARDS_ENABLED)
|
||||
|
||||
if v.house:
|
||||
AWARDS[v.house] = HOUSE_AWARDS[v.house]
|
||||
|
@ -139,7 +140,7 @@ def award_thing(v, thing_type, id):
|
|||
|
||||
kind = request.values.get("kind", "").strip()
|
||||
|
||||
AWARDS = deepcopy(AWARDS2)
|
||||
AWARDS = deepcopy(AWARDS_ENABLED)
|
||||
if v.house:
|
||||
AWARDS[v.house] = HOUSE_AWARDS[v.house]
|
||||
|
||||
|
|
Loading…
Reference in New Issue