Closed igorsimb closed 4 months ago
[!WARNING]
Review failed
The pull request is closed.
The update introduces several enhancements and new features to the project. The backend has been upgraded to Django 5.0, and Alpine.js has been added to the frontend stack. A new demo functionality allows users to create demo accounts with specific quotas and restrictions. Additionally, admin and user management features have been expanded, including new fields and models for user quotas and demo user management. Various templates and views have been updated to support these changes.
Files/Paths | Change Summaries |
---|---|
README.md |
Updated to reflect the backend upgrade to Django 5.0 and the addition of Alpine.js to the frontend stack. |
accounts/admin.py |
Added UserQuota model, QuotaInline class, new fields, filters, and methods in CustomUserAdmin . |
accounts/migrations/0001_initial.py |
Added new fields created_at , is_demo_user , and is_demo_active with default values. |
accounts/migrations/0002_initial.py |
Reordered dependencies in the Migration class. |
accounts/migrations/0003_userquota.py |
Created UserQuota model with fields for tracking user quotas. |
accounts/migrations/0004_rename_number_of_skus_userquota_max_skus.py |
Renamed field number_of_skus to max_skus in userquota model. |
accounts/migrations/0005_alter_customuser_options.py |
Changed model options for CustomUser for better readability in the admin interface. |
accounts/migrations/0006_alter_userquota_options_and_more.py |
Altered model options and renamed field max_skus to max_allowed_skus in userquota model. |
accounts/models.py |
Introduced new fields and properties to CustomUser , created UserQuota model, and updated Meta class. |
accounts/templates/.../demo_error.html |
Added error page for failed demo creation. |
accounts/views.py |
Updated logout_view , added demo_view , and check_expired_demo_users functions. |
config.py |
Introduced configuration settings for the project, including demo user settings and Shepherd.js configuration. |
main/exceptions.py |
Introduced QuotaExceededException class to handle quota-related exceptions. |
main/migrations/0001_initial.py |
Updated Django version, reordered imports, added fields to HistoricalTenant , and created new Tenant model. |
main/migrations/0002_alter_historicaltenant_status_alter_tenant_status.py |
Changed status field in historicaltenant and tenant models to use integer field with predefined choices. |
main/models.py |
Changed default value for status field in Status class from TRIALING to ACTIVE . |
main/tasks.py |
Added QuotaExceededException import, new function for updating user quotas, and task for demo user deactivation. |
main/templates/.../base.html |
Added script tags for "Collapse Plugin" and "Shepherd.js", updated navigation links. |
main/templates/.../index.html |
Added CSS class slide-transition to main element. |
main/templates/.../item_detail.html |
Added conditional blocks for demo-related information and accessibility improvements to pagination. |
main/templates/.../item_list.html |
Added offcanvas panel for demo users, displayed user statistics, and adjusted visual elements. |
main/templates/.../partials/add_items_form.html |
Introduced form for adding new items with conditional rendering based on user type and quota limits. |
main/templates/.../partials/create_interval_form.html |
Added logic to disable submit button and display message when quota is reached. |
main/templates/.../partials/demo_user_quota.html |
Introduced offcanvas display for demo user quotas with registration link. |
main/templates/.../partials/homepage/hero_section.html |
Updated hero section with new button for demo feature and layout adjustments. |
main/views.py |
Added new imports, demo user functionality, updated user quotas, and handled quota-related exceptions. |
mp_monitor/celery.py |
Added periodic task for checking and deactivating expired demo users. |
mp_monitor/settings.py |
Added CELERY_TIMEZONE setting with value "Europe/Moscow" . |
mp_monitor/urls.py |
Added demo_view and check_expired_demo_users to imports and urlpatterns. |
sequenceDiagram
participant User
participant System
participant Admin
participant Scheduler
User->>System: Request demo account
System->>System: Create demo user
System->>System: Set quotas and restrictions
System->>User: Provide access to demo account
Scheduler->>System: Check for expired demo users
System->>System: Deactivate expired demo users
Admin->>System: Manage user quotas
User->>System: Use demo account features
System->>User: Enforce quotas and restrictions
Objective (Issue #52) | Addressed | Explanation |
---|---|---|
Create Demo functionality | ✅ | |
Demo user is created for demo session duration | ✅ | |
TaskForm for the user (max 10-50 SKUs) | ✅ | |
ScrapeIntervalForm for the user | ✅ | |
Demo user is deleted after demo session | ✅ | |
Demo user is deleted every 24 hours | ✅ |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fixes https://github.com/igorsimb/mp-monitor/issues/52