Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flask_wtf/csrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _csrf_protect():
if request.method in ('GET', 'HEAD', 'OPTIONS', 'TRACE'):
return

if self._exempt_views:
if self._exempt_views or self._exempt_blueprints:
if not request.endpoint:
return

Expand All @@ -165,7 +165,7 @@ def _csrf_protect():
dest = '%s.%s' % (view.__module__, view.__name__)
if dest in self._exempt_views:
return
if view.__module__ in self._exempt_blueprints:
if request.blueprint in self._exempt_blueprints:
return

csrf_token = None
Expand Down Expand Up @@ -211,7 +211,7 @@ def some_view():
return
"""
if isinstance(view, Blueprint):
self._exempt_blueprints.add(view.import_name)
self._exempt_blueprints.add(view.name)
return view
if isinstance(view, string_types):
view_location = view
Expand Down