Add @active_subscription_required decorator and start using it (#347)#1069
Open
markstos wants to merge 2 commits into
Open
Add @active_subscription_required decorator and start using it (#347)#1069markstos wants to merge 2 commits into
markstos wants to merge 2 commits into
Conversation
Updates one location to use it as example. This commit is not trying to refactor every potential use of the decorator.
MelissaAutumn
left a comment
Member
There was a problem hiding this comment.
Perf, thanks! I added a couple of sentry issues to this ticket so let's sprinkle it around the application in this PR.
Off the top of my head almost everything in main.views with login_required needs it.
#347) Also: Conditionally reply with JSON vs HTML based the request. Adds missing authorization tests for related locations. Because this is refactor test coverage would not normally be needed, but a number of locations were missing a check to confirm if 403 would be returned without an active subscription.
Contributor
Author
|
I've pushed a commit with the expanded scope requests to address HTML vs H JSON responses and broadly implementing the new decorator. As mentioned in Sentry, the CalDav case turned out to use token auth not the usual auth, so the decorator did not apply there and it was removed from the scope. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates one location to use it as example. This commit is not trying
to refactor every potential use of the decorator.
Why?
This addresses several Sentry exceptions. It's good for DRY and consistency with @login_required.
Limitations and Notes
Applicable Issues
@subscription_requiredannotation #347QA Log
Questions
Should the scope be expanded to refactor more locations in this PR or continue that work in a follow-up PR?