master
Aevann1 2022-02-08 20:58:52 +02:00
parent e112c7623f
commit e25dbda617
3 changed files with 5 additions and 5 deletions

View File

@ -55,6 +55,7 @@ app.config["READ_ONLY"]=bool(int(environ.get("READ_ONLY", "0")))
app.config["BOT_DISABLE"]=bool(int(environ.get("BOT_DISABLE", False))) app.config["BOT_DISABLE"]=bool(int(environ.get("BOT_DISABLE", False)))
app.config["CACHE_TYPE"] = "RedisCache" app.config["CACHE_TYPE"] = "RedisCache"
app.config["CACHE_REDIS_URL"] = environ.get("REDIS_URL", "redis://localhost") app.config["CACHE_REDIS_URL"] = environ.get("REDIS_URL", "redis://localhost")
app.config["CACHE_KEY_PREFIX"] = app.config["SITE_NAME"]
app.config['MAIL_SERVER'] = 'smtp.gmail.com' app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587 app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True app.config['MAIL_USE_TLS'] = True

View File

@ -174,7 +174,7 @@ def front_all(v, sub=None):
filter_words=v.filter_words if v else [], filter_words=v.filter_words if v else [],
gt=gt, gt=gt,
lt=lt, lt=lt,
sub=sub, sub=sub
) )
posts = get_posts(ids, v=v) posts = get_posts(ids, v=v)
@ -266,6 +266,8 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
posts = g.db.query(Submission) posts = g.db.query(Submission)
if sub: posts = posts.filter_by(sub=sub.name) if sub: posts = posts.filter_by(sub=sub.name)
elif SITE_NAME == '2Much4You': posts = posts.filter(Submission.sub != None)
else: posts = posts.filter_by(sub=None)
if gt: posts = posts.filter(Submission.created_utc > gt) if gt: posts = posts.filter(Submission.created_utc > gt)
if lt: posts = posts.filter(Submission.created_utc < lt) if lt: posts = posts.filter(Submission.created_utc < lt)

View File

@ -79,14 +79,11 @@
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}"> <input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% if SUBS %} {% if SITE_NAME=='2Much4You' %}
<label class='mt-4' for="title">Sub</label> <label class='mt-4' for="title">Sub</label>
<div class="input-group mb2"> <div class="input-group mb2">
<select autocomplete="off" id='sub' class="form-control" form="submitform" name="sub"> <select autocomplete="off" id='sub' class="form-control" form="submitform" name="sub">
<option {% if not sub %}selected{% endif %}>
general
</option>
{% for s in SUBS %} {% for s in SUBS %}
<option value="{{s}}" {% if sub.name == s %}selected{% endif %}> <option value="{{s}}" {% if sub.name == s %}selected{% endif %}>
/s/{{s}} /s/{{s}}