feat: add name_manually_edited field to User model and update related functionality
All checks were successful
CI / lint-and-test (push) Successful in 15s
All checks were successful
CI / lint-and-test (push) Successful in 15s
- Introduced a new boolean column `name_manually_edited` in the `users` table to control whether user names are overwritten during synchronization with Telegram. - Updated the `get_or_create_user` function to respect the `name_manually_edited` flag, ensuring names are only updated when the flag is false. - Implemented a new function `update_user_display_name` to allow manual updates of user names while setting the `name_manually_edited` flag to true. - Enhanced unit tests to cover the new functionality and ensure correct behavior of name handling based on the `name_manually_edited` flag.
This commit is contained in:
@@ -21,6 +21,7 @@ from duty_teller.db.repository import (
|
||||
get_duties,
|
||||
insert_duty,
|
||||
set_user_phone,
|
||||
update_user_display_name,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
@@ -42,6 +43,7 @@ __all__ = [
|
||||
"get_duties",
|
||||
"insert_duty",
|
||||
"set_user_phone",
|
||||
"update_user_display_name",
|
||||
"init_db",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user