plone / plone.protect

HTTP protection utilities for the Plone CMS
https://pypi.org/project/plone.protect/
7 stars 8 forks source link

Allow usage for view class methods #17

Open saily opened 9 years ago

saily commented 9 years ago

We should build a little bit more intelligence into request retrieval here: https://github.com/plone/plone.protect/blob/master/plone/protect/utils.py#L22

I'd suggest to use something simliar to:

    request = getattr(context, 'request', getattr(context, 'REQUEST', getRequest()))
vangheem commented 9 years ago

Using getRequest() should be sufficient.