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

remainder changed from list to tuple after secure handled #105

Merged
merged 1 commit into from Apr 2, 2019

Conversation

missuor
Copy link
Contributor

@missuor missuor commented Mar 29, 2019

ref:pecan.secure._SecuredAttribute._lookup

    @_secure_method('_check_permissions')
    @expose()
    def _lookup(self, *remainder):
        return self.obj, remainder # <=== Here !

ref: pecan.rest:RestController._handle_get

    def _handle_get(self, method, remainder, request=None):
        '''
        Routes ``GET`` actions to the appropriate controller.
        '''
        if request is None:
            self._raise_method_deprecation_warning(self._handle_get)

        # route to a get_all or get if no additional parts are available
        if not remainder or remainder == ['']: # <=== Here! ( ('',) is not equal to [''] and controller goes to be a `get_one`

example:

/some/urls/to/controller ==> Controller.get_all
/some/urls/to/controller/ ==> Controller.get_one

urls above should route to Controller.get_all

ref:pecan.secure._SecuredAttribute._lookup
```
    @_secure_method('_check_permissions')
    @expose()
    def _lookup(self, *remainder):
        return self.obj, remainder # <=== Here !

```
ref: pecan.rest:RestController._handle_get
```
    def _handle_get(self, method, remainder, request=None):
        '''
        Routes ``GET`` actions to the appropriate controller.
        '''
        if request is None:
            self._raise_method_deprecation_warning(self._handle_get)

        # route to a get_all or get if no additional parts are available
        if not remainder or remainder == ['']: # <=== Here! ( ('',) is not equal to [''] and controller goes to be a `get_one`
...
```
@ryanpetrello ryanpetrello merged commit 2300de6 into pecan:master Apr 2, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants