Skip to content

fix(api): prevent /api/user/settings AttributeError on Profile#71

Merged
gregagi merged 1 commit intomainfrom
fix/sentry-clawrn1-has-active-subscription
Feb 28, 2026
Merged

fix(api): prevent /api/user/settings AttributeError on Profile#71
gregagi merged 1 commit intomainfrom
fix/sentry-clawrn1-has-active-subscription

Conversation

@gregagi
Copy link
Copy Markdown
Owner

@gregagi gregagi commented Feb 28, 2026

Summary

  • add Profile.has_active_subscription compatibility property used by /api/user/settings
  • preserve existing subscription semantics (TRIAL_STARTED, SUBSCRIBED, CANCELLED, plus prod superuser override)
  • add regression tests for /api/user/settings response when user is unsubscribed vs subscribed

Why

Sentry issue CLAWRN-1 shows /api/user/settings can raise:
AttributeError: 'Profile' object has no attribute 'has_active_subscription'.

This patch restores the expected model property and protects the endpoint with coverage.

Validation

  • ENVIRONMENT=test SECRET_KEY=test DEBUG=1 SITE_URL=http://testserver uv run pytest apps/api/test_user_settings_api.py -q

@gregagi gregagi merged commit 3808906 into main Feb 28, 2026
1 check passed
@gregagi gregagi deleted the fix/sentry-clawrn1-has-active-subscription branch February 28, 2026 04:44
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.

1 participant