mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
fix: internal error when user is none in service api call (#129)
This commit is contained in:
1 parent
c6f715861a
commit
b42cd38cc9
1 file changed
+3
@@ -281,6 +281,9 @@ class PubHandler:
|
||||
|
||||
@classmethod
|
||||
def generate_channel_name(cls, user: Union[Account | EndUser], task_id: str):
|
||||
if not user:
|
||||
raise ValueError("user is required")
|
||||
|
||||
user_str = 'account-' + user.id if isinstance(user, Account) else 'end-user-' + user.id
|
||||
return "generate_result:{}-{}".format(user_str, task_id)
|
||||
|
||||
|
||||
Reference in new issue
Block a user