Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't overwrite mr._request with None in FieldSet.bind #66

Open
benbeanfield opened this issue Sep 9, 2015 · 0 comments
Open

Don't overwrite mr._request with None in FieldSet.bind #66

benbeanfield opened this issue Sep 9, 2015 · 0 comments

Comments

@benbeanfield
Copy link

The FieldSet constructor accepts a request kwarg. If it is supplied, then self._request will be non-None.

FieldSet.bind() also accepts a request object as a kwarg with a default of None. If a request is not supplied to bind(), then bind() will overwrite mr._request with None:

    def bind(self, model=None, session=None, data=None, request=None,
             with_prefix=True):
        # ...
        mr = object.__new__(self.__class__)
        mr.__dict__ = dict(self.__dict__)
        # ...
        mr._request = request
        return mr

bind() should not set mr._request if request is None or falsy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant