Reversion update: handle case when view doesn't have name

This commit is contained in:
Mark Mishyn 2020-01-09 10:11:09 +03:00 committed by Aleksi Häkli
parent dfaf67810a
commit 06e00d08f1

View file

@ -266,7 +266,8 @@ a workaround with a monkeypatch function that functions correctly.
from reversion import views
def _request_creates_revision(request):
if resolve(request.path_info).url_name.endswith("login"):
view_name = resolve(request.path_info).url_name
if view_name and view_name.endswith('login'):
return False
return request.method not in ["OPTIONS", "GET", "HEAD"]