diff --git a/files/classes/user.py b/files/classes/user.py index f7997ef1d..a6b123c06 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -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 diff --git a/files/helpers/const.py b/files/helpers/const.py index 12f250356..efb2d531d 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -140,6 +140,7 @@ AGENDAPOSTER_MSG_HTML = """
Hi {{sub.sidebar_html|safe}}
{% endif %}
{% if v %}
- CREATE HOLE
+ {% if v.can_create_hole -%}
+ CREATE HOLE
+ {%- endif %}
{% if v.mods(sub.name) %}
HOLE SETTINGS
{% endif %}
@@ -29,7 +31,9 @@
HOLE FOLLOWERS
HOLE BLOCKERS
{% else %}
- CREATE HOLE
+ {% if v and v.can_create_hole -%}
+ CREATE HOLE
+ {%- endif %}
BROWSE HOLES