Check OAuth token in @webapi_check_local_site
Review Request #9079 — Created July 17, 2017 and submitted
This patch updates
@webapi_check_local_site
to ensure that if the user
is using an OAuth2 access token that it is valid for the current Local
Site.Web API test mixins classes have been added so that this logic can be
tested for all resources.
Ran unit tests.
Description | From | Last Updated |
---|---|---|
It looks like you posted the wrong change here? |
david | |
F401 'djblets.webapi.errors.NOT_LOGGED_IN' imported but unused |
reviewbot | |
Why is this commented out? Same below. |
david | |
E303 too many blank lines (2) |
reviewbot | |
Here we compare directly against None, whereas below (in the next conditional), we just check truthiness. Is this correct? Or … |
chipx86 | |
The other logging statements are out of date. These should now have a request=request argument, and the three initial request.* … |
chipx86 | |
Swap these. |
chipx86 | |
This method should really be purely about setting things up to work with a Local Site. I don't think we … |
chipx86 | |
I don't really understand this. "Meant for a local site on the root"? |
chipx86 | |
The two Local Site-related assignments are redundant. |
chipx86 | |
These would be better as creates + IntegrityError checks. It'll keep query counts down (otherwise, we're doing 2 in most … |
chipx86 | |
E999 SyntaxError: invalid syntax |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot |
- Commit:
-
a93b44d74e75d235e09843a868e847fca5ecd97e
Checks run (2 succeeded)
-
-
Here we compare directly against
None
, whereas below (in the next conditional), we just check truthiness. Is this correct? Or can we just check truthiness in both? -
The other logging statements are out of date. These should now have a
request=request
argument, and the three initialrequest.*
args should be removed. The logging handler will take care to log these details. -
-
This method should really be purely about setting things up to work with a Local Site. I don't think we want to complicate it by then amking the usage of a Local Site optional. It seems that we only have the one basic test using this (and then the GET equivalent used the GET version of this test). Can we just change up the logic in those to use the non-site versions of this, and to perform the tests needed?
This applies to the equivalent versions of this.
-
-
-
These would be better as creates +
IntegrityError
checks. It'll keep query counts down (otherwise, we're doing 2 in most cases now).
- Commit:
-
a93b44d74e75d235e09843a868e847fca5ecd97eb60473b5ef7713aead80668421d9e6058b651ce9
- Diff:
-
Revision 5 (+682 -50)