fixed 属性判断

This commit is contained in:
xxqfamous 2023-06-08 17:28:09 +08:00
parent 635ca7ca4b
commit 7bebe42c49
1 changed files with 1 additions and 1 deletions

View File

@ -877,7 +877,7 @@ class User < Owner
# 重写gitea_token,当用户为bot类型时替换成管理员token
def gitea_token
if self.platform == "bot"
if self.respond_to?('platform') && self.platform == "bot"
GiteaService.gitea_config[:admin_token]
else
self['gitea_token']