Merge lp:~leonardr/lazr.restful/disable-cache into lp:lazr.restful
| Status: | Merged |
|---|---|
| Approved by: | Gary Poster on 2010-06-03 |
| Approved revision: | 134 |
| Merged at revision: | 132 |
| Proposed branch: | lp:~leonardr/lazr.restful/disable-cache |
| Merge into: | lp:lazr.restful |
| Diff against target: |
114 lines (+50/-6) 4 files modified
src/lazr/restful/NEWS.txt (+5/-0) src/lazr/restful/_resource.py (+29/-5) src/lazr/restful/docs/multiversion.txt (+15/-0) src/lazr/restful/version.txt (+1/-1) |
| To merge this branch: | bzr merge lp:~leonardr/lazr.restful/disable-cache |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gary Poster | 2010-06-02 | Approve on 2010-06-03 | |
|
Review via email:
|
|||
Description of the Change
Argh, I got so used to running Launchpad integration and performance tests in my previous branch that I forgot to run the lazr.restful test suite before landing. My optimized implementation of redacted_fields fails in three cases, each of which was covered by one or another of the various example web services defined in lazr.restful:
1. when there is no Zope permission checker registered for an IEntry implementation
2. when a failure results in a ForbiddenAttribute exception rather than an Unauthorized exception
3. when an IEntry implementation was defined from scratch and as such lacks tagged values (specifically, lacks 'original_name')
I changed redacted_fields to handle all these cases. I'm not really sure why sometimes a permission failure would result in ForbiddenAttribute and sometimes in Unauthorized, but it does happen.
- 134. By Leonard Richardson on 2010-06-03
-
Removed the special hack for ForbiddenAttribute errors.
| Leonard Richardson (leonardr) wrote : | # |
> In 'src/lazr/
> zope.security.
> zope.security.
Done.
> In the same file, why is ``tagged_values =
> field.getTagged
> It seems like the check for original_name is the only line that should be
> there.
If there are no tagged values at all, then field.getTagged
Leonard
- 135. By Leonard Richardson on 2010-06-03
-
Response to feedback.

Looks good, thank you.
In 'src/lazr/ restful/ _resource. py', please revert ``from zope.security. interfaces import ForbiddenAttribute, Unauthorized`` to ``from zope.security. interfaces import Unauthorized``.
In the same file, why is ``tagged_values = field.getTagged Value(' lazr.restful. exported' )`` within the try-except block? It seems like the check for original_name is the only line that should be there.
Gary