Skip to content

feat: add trial check and don't allow forecast access - #365

Open
suvanbanerjee wants to merge 5 commits into
mainfrom
feat/block-trial-users
Open

feat: add trial check and don't allow forecast access#365
suvanbanerjee wants to merge 5 commits into
mainfrom
feat/block-trial-users

Conversation

@suvanbanerjee

@suvanbanerjee suvanbanerjee commented Aug 13, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

Restrict free trail expired users to only see past values and block future forecast

Fixes #352

How Has This Been Tested?

  • Locally

UI after api blocking

Screenshot From 2026-08-14 23-18-10 Screenshot From 2026-08-14 23-18-30

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@suvanbanerjee
suvanbanerjee requested a review from braddf August 13, 2026 05:05
@suvanbanerjee suvanbanerjee changed the title feat(v0):add trial check and don't allow forecast access feat: add trial check and don't allow forecast access Aug 13, 2026
Comment on lines +14 to 15
#TODO: verify this string with brad
cache_dependent_scopes = ["read:intraday"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@braddf I think it should be read:uk-intraday? as in thwe time utils we are checking for

if "read:uk-intraday" in permissions:
        return min(end_datetime_utc, intraday_max_allowed)

Comment on lines +19 to +21
No claim at all (paid/non-trial user) is treated the same as an unexpired
trial: both mean "don't clamp." Only a claim that has actually passed
counts as expired.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@braddf I’ve assumed that if a user does not have the trial_ends_at attribute, they are a paid user. Is this assumption correct?

@suvanbanerjee
suvanbanerjee marked this pull request as ready for review August 14, 2026 18:23
@suvanbanerjee suvanbanerjee self-assigned this Aug 14, 2026
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.

feat: Restrict free/trial expired users to past forecasts only

1 participant