New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-staff user causes Exception when trying to access /admin/ #1114

Closed
procmail opened this Issue Sep 8, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@procmail
Contributor

procmail commented Sep 8, 2014

Hi,

When I'm logged in as a non-staff user, and try to access /admin/, I get the following:

DoesNotExist at /admin/login/
SitePermission matching query does not exist.
Request Method: GET
Request URL:    http://10.211.55.20/admin/login/?next=/admin/
Django Version: 1.7
Exception Type: DoesNotExist
Exception Value:    
SitePermission matching query does not exist.
Exception Location: /home/deric/.virtualenvs/reader/lib/python3.4/site-packages/django/db/models/query.py in get, line 357
Python Executable:  /home/deric/.virtualenvs/reader/bin/python
Python Version: 3.4.1
Python Path:    
['/home/deric/.virtualenvs/reader/reader',
 '/usr/local/lib/python34.zip',
 '/usr/local/lib/python3.4',
 '/usr/local/lib/python3.4/plat-linux',
 '/usr/local/lib/python3.4/lib-dynload',
 '/home/deric/.virtualenvs/reader/lib/python3.4/site-packages',
 '/home/deric/.virtualenvs/reader']
Server time:    Mon, 8 Sep 2014 14:56:55 +0800
Error during template rendering

In template /home/deric/.virtualenvs/reader/lib/python3.4/site-packages/mezzanine/core/templates/admin/base_site.html, error at line 51
SitePermission matching query does not exist.
41  
42  {% endblock %}
43  
44  {% block rtl_styles %}
45  {{ block.super }}
46  <link rel="stylesheet" type="text/css" href="{% static "mezzanine/css/admin/rtl.css" %}" />
47  {% endblock %}
48  
49  {% block before_content %}
50  {% if user.is_authenticated and not is_popup and not request.GET.pop %}
51  {% admin_dropdown_menu %}
52  {% endif %}
53  {% endblock %}
54  
55  {% block footer %}
56  {% if form.this_is_the_login_form %}
57      <script src="{% static "mezzanine/js/admin/login.js" %}"></script>
58  {% else %}
59      {% if user.is_authenticated %}
60          {% if not is_popup and not request.GET.pop %}
61          <link rel="stylesheet" href="{% static "mezzanine/chosen/chosen.css" %}">

Changed line 50 of base_site.html to avoid this:

{% if user.is_authenticated and user.is_staff and not is_popup and not request.GET.pop %}
@stephenmcd

This comment has been minimized.

Show comment
Hide comment
@stephenmcd

stephenmcd Sep 8, 2014

Owner

Thanks for the report!

Owner

stephenmcd commented Sep 8, 2014

Thanks for the report!

@stephenmcd stephenmcd closed this in 6db0f1c Sep 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment