|
@@ -18,7 +18,7 @@ class ConversationListApi(WebApiResource):
|
|
|
@marshal_with(conversation_infinite_scroll_pagination_fields)
|
|
|
def get(self, app_model, end_user):
|
|
|
app_mode = AppMode.value_of(app_model.mode)
|
|
|
- if app_mode not in [AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT]:
|
|
|
+ if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}:
|
|
|
raise NotChatAppError()
|
|
|
|
|
|
parser = reqparse.RequestParser()
|
|
@@ -56,7 +56,7 @@ class ConversationListApi(WebApiResource):
|
|
|
class ConversationApi(WebApiResource):
|
|
|
def delete(self, app_model, end_user, c_id):
|
|
|
app_mode = AppMode.value_of(app_model.mode)
|
|
|
- if app_mode not in [AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT]:
|
|
|
+ if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}:
|
|
|
raise NotChatAppError()
|
|
|
|
|
|
conversation_id = str(c_id)
|
|
@@ -73,7 +73,7 @@ class ConversationRenameApi(WebApiResource):
|
|
|
@marshal_with(simple_conversation_fields)
|
|
|
def post(self, app_model, end_user, c_id):
|
|
|
app_mode = AppMode.value_of(app_model.mode)
|
|
|
- if app_mode not in [AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT]:
|
|
|
+ if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}:
|
|
|
raise NotChatAppError()
|
|
|
|
|
|
conversation_id = str(c_id)
|
|
@@ -92,7 +92,7 @@ class ConversationRenameApi(WebApiResource):
|
|
|
class ConversationPinApi(WebApiResource):
|
|
|
def patch(self, app_model, end_user, c_id):
|
|
|
app_mode = AppMode.value_of(app_model.mode)
|
|
|
- if app_mode not in [AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT]:
|
|
|
+ if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}:
|
|
|
raise NotChatAppError()
|
|
|
|
|
|
conversation_id = str(c_id)
|
|
@@ -108,7 +108,7 @@ class ConversationPinApi(WebApiResource):
|
|
|
class ConversationUnPinApi(WebApiResource):
|
|
|
def patch(self, app_model, end_user, c_id):
|
|
|
app_mode = AppMode.value_of(app_model.mode)
|
|
|
- if app_mode not in [AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT]:
|
|
|
+ if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}:
|
|
|
raise NotChatAppError()
|
|
|
|
|
|
conversation_id = str(c_id)
|