2
votes

I have a problem with my wagtail admin interface. In my urls.py I put it like that:

url(r'^cms-admin/', include(wagtailadmin_urls)),
url(r'^cms-search/', include(wagtailsearch_frontend_urls)),
url(r'^cms-documents/', include(wagtaildocs_urls)),   
url(r'', include(wagtail_urls)),

All links except the one to users (/cms-admin/users/) work fine. When I go to /cms-admin/users/ I get the following error:

NoReverseMatch at /cms-admin/users/
Reverse for 'wagtailusers_edit' with arguments '(-1L,)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['cms-admin/users/(\\d+)/$']

Further down I see that Django tries to render a template and has problems with that line:

 <a href="{% url 'wagtailusers_edit' user.id %}">{{ user.get_full_name|default:user.username }}</a>

Does anyone have an idea what I am doing wrong?

Thanks Magda

EDIT

OK, I found out myself - the problem is that I have an anonymous user with the ID -1 and wagtail uses that pattern: ['cms-admin/users/(\\d+)/$']. Still I don't know how to solve this.

1

1 Answers

0
votes

Django has an AnonymousUser class that looks like a model object but isn't stored in the database, I'm assuming you're not using this one.

Do you want to allow editing this anonymous user?

If yes, you can edit your existing urlpatterns, find the appropriate RegexURLPattern object and replace it with an identical one with a different regex.

If not, you could look into limiting the query set that the view in question receives and filtering your anonymous user out.