Fix Admin Panel link from deprecating session type

1318-submissions-api-improvements
Kevin Chung 2020-04-15 03:38:25 -04:00
parent 0cfbf90201
commit e113b2d627
2 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@
<ul class="navbar-nav ml-md-auto d-block d-sm-flex d-md-flex">
{% if authed() %}
{% if type == 'admin' %}
{% if is_admin() %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('admin.view') }}">
<span class="d-block" data-toggle="tooltip" data-placement="bottom" title="Admin Panel">

View File

@ -38,7 +38,7 @@ from CTFd.utils.plugins import (
)
from CTFd.utils.security.auth import login_user, logout_user, lookup_user_token
from CTFd.utils.security.csrf import generate_nonce
from CTFd.utils.user import authed, get_current_team, get_current_user, get_ip
from CTFd.utils.user import authed, get_current_team, get_current_user, get_ip, is_admin
def init_template_filters(app):
@ -75,6 +75,7 @@ def init_template_globals(app):
app.jinja_env.globals.update(get_mode_as_word=get_mode_as_word)
app.jinja_env.globals.update(integrations=integrations)
app.jinja_env.globals.update(authed=authed)
app.jinja_env.globals.update(is_admin=is_admin)
def init_logs(app):