Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions auth_backend/auth_method/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async def _unregister(cls, user_session: UserSession = Depends(UnionAuth(scopes=
new_user = {"user_id": user_session.user.id}
old_user_params = await cls._delete_auth_methods(user_session.user, db_session=db.session)
old_user[cls.get_name()] = old_user_params
await cls._delete_userdata(user=user_session.user, db_session=db.session)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мне вот очень интересно
а откуда ты взяла этот метод???)00)))

image его нет в проекте

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавила новый метод класса, проверь пожалуйста, насколько это корректно

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@classmethod
async def _delete_userdata(cls, user: User, *, db_session: DbSession) -> None:
    """Удаление  данных пользователя
    
    Args:
        user (User): Объект пользователя
        db_session (DbSession): Сессия базы данных
    Returns: 
        Ничего? 
    """
    raise NotImplementedError()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавила @AbstractMethod после @classmethod

await AuthPluginMeta.user_updated(new_user, old_user)
return None

Expand Down
13 changes: 13 additions & 0 deletions auth_backend/auth_method/userdata_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,16 @@ def userdata_process_empty_strings(cls, userdata: UserLogin) -> UserLogin:
if item.value == '':
item.value = None
return userdata

@classmethod
@abstractmethod
async def _delete_userdata(cls, user: User, *, db_session: DbSession) -> None:
"""Удаление данных пользователя

Args:
user (User): Объект пользователя
db_session (DbSession): Сессия базы данных
Returns:
Ничего?
"""
raise NotImplementedError()
Loading