Skip to content

Commit

Permalink
add impersonate url
Browse files Browse the repository at this point in the history
  • Loading branch information
vicalloy committed Apr 10, 2020
1 parent 223eae4 commit d812e5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion carrot_box/settings/base.py
Expand Up @@ -149,7 +149,6 @@
]
LOGIN_URL = '/admin/login/'
LOGOUT_URL = '/admin/logout/'
IMPERSONATE_REDIRECT_URL = '/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL_ = '/media/'
Expand Down Expand Up @@ -215,3 +214,8 @@
AUTHENTICATION_BACKENDS = (
'carrot_box.hr.backends.CarrotModelBackend',
)

IMPERSONATE = {
'REDIRECT_URL': '/',
'PAGINATE_COUNT': 20,
}
6 changes: 6 additions & 0 deletions carrot_box/templates/base_ext.html
Expand Up @@ -3,5 +3,11 @@
{% block header_nav_left %}
<ul class="nav navbar-nav">
<li><a href="https://github.com/vicalloy/carrot-box">Fork me on GitHub</a></li>
{% if user.is_superuser %}
<li><a href="{% url 'impersonate-list' %}">Switch user</a></li>
{% endif %}
{% if user.is_impersonate %}
<li><a href="{% url 'impersonate-stop' %}">Stop impersonate</a></li>
{% endif %}
</ul>
{% endblock %}

0 comments on commit d812e5d

Please sign in to comment.