Skip to content

Commit

Permalink
fix: 修复用户信息更新失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
nineaiyu committed Apr 25, 2024
1 parent 42cac24 commit 972aac7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion system/utils/signal_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def clean_cache_handler(sender, instance, **kwargs):
logger.info(f"invalid cache {sender}")

if issubclass(sender, UserInfo):
if {'roles', 'rules', 'dept', 'mode_type'} & set(update_fields):
if update_fields is None or {'roles', 'rules', 'dept', 'mode_type'} & set(update_fields):
invalid_user_cache(instance.pk)
else:
cache_response.invalid_cache(f'UserInfoView_retrieve_{instance.pk}')
Expand Down
1 change: 1 addition & 0 deletions system/views/user/userinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
class UserInfoView(OwnerModelSet, UploadFileAction):
serializer_class = UserInfoSerializer
FILE_UPLOAD_FIELD = 'avatar'
choices_models = [UserInfo]

def get_object(self):
return self.request.user
Expand Down

0 comments on commit 972aac7

Please sign in to comment.