forked from rDrama/rDrama
WPD: limit hole creation to JL2+.
parent
4166b2d2f0
commit
e2cd25db67
|
@ -740,3 +740,8 @@ class User(Base):
|
|||
@lazy
|
||||
def lottery_stats(self):
|
||||
return { "winnings": self.total_lottery_winnings, "ticketsHeld": { "current": self.currently_held_lottery_tickets , "total": self.total_held_lottery_tickets } }
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def can_create_hole(self):
|
||||
return self.admin_level >= HOLE_CREATE_JL_MIN
|
||||
|
|
|
@ -140,6 +140,7 @@ AGENDAPOSTER_MSG_HTML = """<p>Hi <a href="/id/{id}"><img loading="lazy" src="/pp
|
|||
################################################################################
|
||||
|
||||
HOLE_COST = 0
|
||||
HOLE_CREATE_JL_MIN = 0
|
||||
HOLE_INACTIVITY_DELETION = False
|
||||
PIN_LIMIT = 3
|
||||
POST_RATE_LIMIT = '1/second;2/minute;10/hour;50/day'
|
||||
|
@ -279,7 +280,7 @@ elif SITE == 'cringetopia.org':
|
|||
"7": "886781932430565418",
|
||||
}
|
||||
elif SITE == 'watchpeopledie.co':
|
||||
HOLE_COST = 10000
|
||||
HOLE_CREATE_JL_MIN = 2
|
||||
|
||||
GIFT_NOTIF_ID = 13
|
||||
CARP_ID = 13
|
||||
|
|
|
@ -265,13 +265,17 @@ def remove_mod(v, sub):
|
|||
@app.get("/create_hole")
|
||||
@is_not_permabanned
|
||||
def create_sub(v):
|
||||
if not v.can_create_hole:
|
||||
abort(403)
|
||||
|
||||
return render_template("sub/create_hole.html", v=v, cost=HOLE_COST)
|
||||
|
||||
|
||||
@app.post("/create_hole")
|
||||
@is_not_permabanned
|
||||
def create_sub2(v):
|
||||
if not v.can_create_hole:
|
||||
abort(403)
|
||||
|
||||
name = request.values.get('name')
|
||||
if not name: abort(400)
|
||||
name = name.strip().lower()
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
|
||||
{% endif %}
|
||||
{% if v %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{% if v.can_create_hole -%}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{%- endif %}
|
||||
{% if v.mods(sub.name) %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/settings">HOLE SETTINGS</a>
|
||||
{% endif %}
|
||||
|
@ -29,7 +31,9 @@
|
|||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/followers">HOLE FOLLOWERS</a>
|
||||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/blockers">HOLE BLOCKERS</a>
|
||||
{% else %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{% if v and v.can_create_hole -%}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{%- endif %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/holes">BROWSE HOLES</a>
|
||||
|
||||
<div class="mt-4">
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/blockers">HOLE BLOCKERS</a>
|
||||
{% endif %}
|
||||
|
||||
<a class="btn btn-primary btn-block" href="/create_hole">CREATE HOLE</a>
|
||||
{% if v and v.can_create_hole -%}
|
||||
<a class="btn btn-primary btn-block" href="/create_hole">CREATE HOLE</a>
|
||||
{%- endif %}
|
||||
<a class="btn btn-primary btn-block" href="/holes">BROWSE HOLES</a>
|
||||
<a class="btn btn-primary btn-block mt-5" href="https://ip2.network">STREAM LIST</a>
|
||||
<a class="btn btn-primary btn-block" href="/post/4103">BUGS/SUGGESTIONS MEGATHREAD</a>
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
|
||||
{% endif %}
|
||||
{% if v %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{% if v.can_create_hole -%}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{%- endif %}
|
||||
{% if v.mods(sub.name) %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/settings">HOLE SETTINGS</a>
|
||||
{% endif %}
|
||||
|
|
|
@ -63,7 +63,9 @@ set VISITORS_HERE_FLAVOR = [
|
|||
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
|
||||
{% endif %}
|
||||
{% if v %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{% if v.can_create_hole -%}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{%- endif %}
|
||||
{% if v.mods(sub.name) %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/settings">HOLE SETTINGS</a>
|
||||
{% endif %}
|
||||
|
@ -78,9 +80,9 @@ set VISITORS_HERE_FLAVOR = [
|
|||
<span id="sidebar--directory--subhead">Submit Marseys & Art | Info Megathreads</span>
|
||||
</a>
|
||||
<a class="btn btn-primary btn-block mb-3" href="/holes">BROWSE HOLES</a>
|
||||
{% if v %}
|
||||
{% if v and v.can_create_hole -%}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<div class="rules mt-5">
|
||||
<h3>Rules:</h3><br>
|
||||
|
|
Loading…
Reference in New Issue