tptimer/env/lib/python2.7/site-packages/wtforms/ext/csrf/fields.py

19 lines
430 B
Python
Raw Normal View History

2018-07-20 05:43:02 +00:00
from wtforms.fields import HiddenField
class CSRFTokenField(HiddenField):
current_token = None
def _value(self):
"""
We want to always return the current token on render, regardless of
whether a good or bad token was passed.
"""
return self.current_token
def populate_obj(self, *args):
"""
Don't populate objects with the CSRF token
"""
pass