- Removed `light_color_code` from the Hadis and Transmitter serializers to streamline the API response.
- Updated the `ColorPaletteMixin` to simplify color management by eliminating the light color property, focusing on the main color code.
- Adjusted the serializers to reflect these changes, enhancing clarity and reducing redundancy in color representation.
- Introduced `SimilarArticleSerializer` to provide a structured representation of similar articles, including categories and thumbnail.
- Updated `ArticleDetailSerializer` to include a new `similar_articles` field, which fetches articles from the same categories, excluding the current article.
- Implemented a method to retrieve similar articles, improving the article detail view with relevant content suggestions.
- Introduced `ColorPaletteMixin` to centralize color choice fields and hex code properties across `HadisStatus`, `TransmitterReliability`, and `OpinionStatus` models.
- Updated the `color` field in these models to use the mixin, enhancing code reusability and maintainability.
- Modified serializers to include `main_color_code` and `light_color_code` properties for better color representation in API responses.
- Added a new migration to adjust the database schema for the updated models.
- Introduced the `EmbeddingSession` model to track the status and progress of embedding tasks, including fields for status, progress, processed items, and error messages.
- Created `EmbeddingSessionAdmin` to manage embedding sessions in the admin interface, featuring custom display methods for status badges and progress bars.
- Implemented background processing to trigger a FastAPI agent upon creating a new embedding session, enhancing the system's responsiveness and user experience.
- Added migrations to establish the new model in the database.
- Introduced a `share_link` property in the `Article`, `Hadis`, `Book`, `Podcast`, `Video`, and `Transmitter` models to generate shareable links based on their slugs.
- Updated corresponding serializers to include the `share_link` field as read-only.
- Added a management command to refresh share links for existing Hadis models, ensuring all instances have updated slugs and share links.
- Adjusted the `settings` to define `DOVODI_DOMAIN` for consistent link generation across models.
- Changed `TabularInline` to `StackedInline` for better layout of `AgentPrompt` entries.
- Adjusted the `AdminTextareaWidget` to enhance user experience with improved styling and sizing.
- Ensured the inline management of prompts remains user-friendly and visually appealing in the admin interface.
- Updated `AgentSettings` model to serve as a singleton container, removing unnecessary fields and adding an `updated_at` timestamp.
- Introduced `AgentPrompt` model to manage instruction prompts associated with agent settings.
- Enhanced `AgentSettingsAdmin` to include inline management of prompts, improving the admin interface for better usability.
- Created migrations to reflect the updated model structure and ensure database integrity.
- Introduced `seed_occasions.py` management command to populate the database with a comprehensive list of Persian, International, and Religious calendar occasions.
- Created `__init__.py` files in the management and commands directories to ensure proper package structure.
- Enhanced the seeding process with transaction management for data integrity during the creation of occasions.
- Introduced `OccasionsList` view to retrieve calendar occasions with filtering options for month and last updated timestamp.
- Updated URL patterns to include a new endpoint for syncing occasions and modified the existing occasions endpoint.
- Enhanced the `get_queryset` method to support filtering by month and last updated date, improving data retrieval flexibility.
- Created `Agent` app including models, admin configuration, and migrations for managing agent settings.
- Introduced `AgentSettings` model to store configuration parameters such as system prompt and model settings.
- Implemented `AgentSettingsAdmin` to provide a singleton admin interface for managing agent configurations.
- Registered the app in the project settings for integration.
- Updated `get_children_count` method to calculate the total number of Hadiths in a category and its descendants instead of counting active children categories.
- Enhanced code clarity by removing commented-out code and providing detailed docstrings for the new logic.
- Introduced `add_english_context_category.py` to populate missing English titles and descriptions for HadisCategory.
- Added `english_context.py` to fill in missing English context for Hadith fields including title, narrator, translation, and description.
- Created `arabic_text.py` to replace Hadith text with authentic Arabic texts.
- Updated `CategorySerializer` to calculate the total number of Hadiths in a category and its descendants.
- Removed dependency on `get_admin_namespace` and replaced it with direct language-based URL redirection for admin login in both `AdminAccessMiddleware` and `enhanced_auth_middleware`.
- Improved code clarity by utilizing Django's `get_language` to dynamically construct the redirect URL based on the user's language preference.
- Enhanced user experience by ensuring consistent access to the admin login page across different languages.
- Moved the `get_admin_namespace` function from `admin_access.py` to a new `config.middleware` module for better organization and reusability.
- Updated `AdminAccessMiddleware` to utilize the centralized `get_admin_namespace` function, enhancing code maintainability.
- Improved documentation for the `get_admin_namespace` function to clarify its usage and purpose.
- Introduced a new function `get_admin_namespace` to determine the appropriate admin namespace based on the request domain (Dovoodi or Imam Javad).
- Updated `AdminAccessMiddleware` and `enhanced_auth_middleware` to utilize the new function for redirecting users to the correct admin login page, enhancing access control based on the domain.
- Improved code readability and maintainability by centralizing the logic for admin namespace resolution.
- Enhanced session handling by checking for active sessions before creating a new room in PlugNMeet, reducing unnecessary API calls.
- Implemented logic to reactivate ended sessions and log relevant actions for better traceability.
- Added conditional room creation to avoid duplicate rooms, improving overall efficiency and user experience.
- Updated CourseLiveSessionRoomCreateAPIView to filter out ended sessions by adding `ended_at__isnull=True` in the session creation logic.
- Introduced a new method in CourseLiveSessionTokenAPIView to build centralized metadata for room settings, ensuring client overrides are not permitted and enhancing session configuration consistency.
- Updated CourseLiveSessionRoomCreateAPIView to filter out ended sessions by adding `ended_at__isnull=True` in the session creation logic.
- Introduced a new method in CourseLiveSessionTokenAPIView to build centralized metadata for room settings, ensuring client overrides are not permitted and defining default lock settings and room features.
- Improved room verification logic in CourseLiveSessionTokenAPIView to handle both boolean and string responses for room activity status.
- Added functionality to automatically recreate inactive rooms for professors while denying token issuance for students if the room is inactive.
- Enhanced logging for better traceability of room status and actions taken during token requests.
- Introduced a new method to handle room recreation in PlugNMeet, ensuring sessions can be reactivated when necessary.
- Added TokenAuthentication to allow users to authenticate with a token while still permitting access without authentication.
- Removed redundant debug print statements related to token validation to streamline the code and improve readability.
- Added checks in get_saved_location method to ensure user is authenticated and has location_history attribute before attempting to access it.
- Improved robustness of location retrieval logic to prevent errors for unauthenticated users.
- Updated permission classes to allow any user for GET requests, enhancing accessibility.
- Added detailed logging for both GET and POST requests to track request data and processing steps.
- Improved handling of user authentication status in log messages for better traceability.
- Added detailed logging for GET and POST requests in CourseOnlineClassTokenValidateAPIView to track user actions and course validation.
- Improved logging in OnlineClassTokenManager for token generation, storage, retrieval, and deletion processes, including error handling for Redis interactions.
- Commented out the entire class and method definitions for the PlugNMeetWebhookAPIView to facilitate debugging and future modifications.
- Retained the structure and docstrings for clarity on event handling and signature verification.
- Enhanced debug logging for signature verification to assist in identifying issues during development.
- Updated permission logic for course management.
- Simplified room ID setup and metadata handling.
- Enhanced PlugNMeetClient integration for room creation and token generation.
- Improved error handling and logging for API interactions.
- Adjusted response structure to include the generated access token for frontend use.
- Updated the _verify_webhook_signature method to include detailed debug logging for better traceability of signature verification issues.
- Improved error messages for missing headers and configuration settings.
- Added checks for empty request bodies to assist in identifying middleware issues.
- Adjusted logging to prevent sensitive information exposure while still providing useful debugging information.
- Implemented validation and permission checks for course management.
- Updated room ID generation to comply with NATS rules by prefixing with 'room-'.
- Integrated JWT token generation for user access to live sessions.
- Improved error handling for PlugNMeet API interactions.
- Enhanced response structure to include access token for frontend connectivity.
- Introduced a new command to evenly distribute source types across existing HadisCategory instances.
- Added a command to seed categories and collections in the library, relating existing books to them.
- Enhanced HadisCategory model to allow Unicode in slugs through a migration.
- Updated Nginx configuration to include a new location for proxying requests to a FastAPI agent.
- Added a COLOR_PALETTE dictionary to the HadisStatus model for color management.
- Introduced properties to retrieve main and light color codes based on the selected color.
- Updated HadisStatusSerializer to include read-only fields for main and light color codes.
- Enabled the population of books in the entrypoint script by uncommenting the relevant command.
- Introduced a new geolocation package containing APIs for IP-based geolocation, reverse geocoding, and region information.
- Added URL routes for geolocation endpoints in the account app.
- Implemented models, serializers, and views for handling geolocation data.
- Included GeoLite2 databases for IP to city and country lookups.
- Enhanced location history updates with optimized batch processing for improved performance.
- Updated settings to include the new geolocation package in installed apps.
- Updated the queryset filtering in TransmitterView to correctly filter by reliability slug instead of the reliability field directly.
- This change ensures that the API correctly interprets the status filter provided in the query parameters.
- Implemented HadisCategoryXMindView to retrieve a mind-map JSON structure for specific hadis categories.
- Added Swagger documentation detailing the endpoint's features, usage, and response structure.
- Updated URL routing to include the new endpoint for XMind format retrieval.
- Enhanced the HadisCategoryXMindView to support multi-language content and bookmark status for authenticated users.
- Enhanced the save methods in Hadis, HadisCategory, BookReference, Transmitter, and related models to ensure unique slug generation.
- Implemented robust error handling and fallback mechanisms for slug creation based on title fields, with timestamp-based fallbacks for empty or invalid titles.
- Removed unnecessary thumbnail handling from TransmittersAdmin and simplified the display_header method.
- Improved overall data integrity and consistency in slug management across the application.
- Introduced a new management command to seed OpinionStatus, TransmitterOpinion, and TransmitterOriginalText with multilingual data.
- Implemented logic to create opinion statuses with corresponding colors and titles in English, Farsi, and Russian.
- Added functionality to generate random opinions and original texts for transmitters, ensuring unique titles for each transmitter.
- Enhanced data handling for better integration with existing models and improved seeding process.
- Updated HadisCollectionAdmin and TransmittersAdmin to include a custom display header with thumbnail images.
- Modified list_display to show the new display_header method for better visual representation.
- Added thumbnail field to HadisCollection and Transmitters models, replacing FilerImageField with ImageField for improved image handling.
- Created a migration to alter the thumbnail fields in the database schema.
- Introduced custom forms for Hadis, HadisCollection, HadisTag, HadisStatus, HadisReference, and Transmitters models to utilize JSON editor widgets for better data management.
- Implemented schemas for various JSON fields including titles, descriptions, and addresses to enhance the admin interface.
- Updated list displays in admin classes to show the first text from JSON fields for improved readability.
- Added a management command to seed HadisStatus descriptions with multilingual definitions based on keywords.
- Introduced BookSubjectArea and BookType models with JSONField for titles.
- Added 'description' field to HadisStatus model.
- Updated BookReference model to include ManyToMany relationship with BookSubjectArea and a ForeignKey to BookType.
- Enhanced admin interfaces for HadisStatus, BookReference, and BookAuthor to accommodate new fields and improve usability.