Add configuration rules, refactor settings management, and enhance import functionality
- Introduced a new configuration file `.cursorrules` to define coding standards, error handling, testing requirements, and project-specific guidelines. - Refactored `config.py` to implement a `Settings` dataclass for better management of environment variables, improving testability and maintainability. - Updated the import duty schedule handler to utilize session management with `session_scope`, ensuring proper database session handling. - Enhanced the import service to streamline the duty schedule import process, improving code organization and readability. - Added new service layer functions to encapsulate business logic related to group duty pinning and duty schedule imports. - Updated README documentation to reflect the new configuration structure and improved import functionality.
This commit is contained in:
8
utils/user.py
Normal file
8
utils/user.py
Normal file
@@ -0,0 +1,8 @@
|
||||
"""User display name helpers."""
|
||||
|
||||
|
||||
def build_full_name(first_name: str | None, last_name: str | None) -> str:
|
||||
"""Build display full name from first and last name. Returns 'User' if both empty."""
|
||||
parts = [first_name or "", last_name or ""]
|
||||
full = " ".join(filter(None, parts)).strip()
|
||||
return full or "User"
|
||||
Reference in New Issue
Block a user