Исправлено: Для неанонимных отзывов имя пользователя запрашивается че…#168
Merged
Исправлено: Для неанонимных отзывов имя пользователя запрашивается че…#168
Conversation
…рез UnionAuth._get_userdata. Если в профиле не задано имя, то возвращается ошибка, отзыв не создаётся
|
💩 Code linting failed, use |
Coverage Report
Summary
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
petrCher
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…рез UnionAuth._get_userdata. Если в профиле не задано имя, то возвращается ошибка, отзыв не создаётся
Изменения
Исправлена ошибка, из-за которой у неанонимных отзывов поле user_fullname заполнялось как null
(UnionAuth не отправляет имя пользователя в userdata, а код искал его именно там. В результате значение всегда оставалось null)
Теперь имя пользователя запрашивается через UnionAuth._get_userdata
Если в профиле пользователя не задано имя, то возвращается ошибка, отзыв не создаётся
Детали реализации
В функцию create_comment добавлен параметр request: Request для получения токена из Authorization
Добавлен вызов auth._get_userdata(token, user_id) для получения полных данных пользователя из Auth API
Имя извлекается из поля "Полное имя"
Если имя не найдено, то вызывается ForbiddenAction