You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces several refactoring improvements across the codebase to enhance clarity, remove redundancy, and simplify complex logic.
Key changes include:
- **PromoManager:** Simplified the filtering logic for promo codes by restructuring the query conditions for age and country, making it more readable.
- **Promo Model:** Streamlined property methods (`is_available`, `get_available_unique_codes`) for better readability and consistency.
- **Serializers (`business`, `core`, `user`):**
- Removed unnecessary validation checks that are already handled by Django Rest Framework's default behavior (e.g., required fields).
- Simplified complex conditional logic and improved handling of query parameters (`MultiCountryField`).
- Made user-context checks in `BaseUserPromoSerializer` more direct and less defensive, assuming an authenticated request context.
- **Settings:** Updated paths for password validators to reflect their new location in the `user` application.
0 commit comments