File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 310310# Cherry Chat
311311CHERRY_APP_ID = os .getenv ("CHERRY_APP_ID" , "16e14376-0fce-4536-8891-754fd8fb5748" )
312312CHERRY_APP_SECRET = os .getenv ("CHERRY_APP_SECRET" , "" )
313+ CHERRY_PROJECT_KEY = os .getenv ("CHERRY_PROJECT_KEY" , "" )
313314
Original file line number Diff line number Diff line change 324324# Cherry Chat
325325CHERRY_APP_ID = os .getenv ("CHERRY_APP_ID" , "16e14376-0fce-4536-8891-754fd8fb5748" )
326326CHERRY_APP_SECRET = os .getenv ("CHERRY_APP_SECRET" , "" )
327+ CHERRY_PROJECT_KEY = os .getenv ("CHERRY_PROJECT_KEY" , "" )
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ def post(self, request):
162162
163163 app_id = getattr (settings , 'CHERRY_APP_ID' , '16e14376-0fce-4536-8891-754fd8fb5748' )
164164 app_secret = getattr (settings , 'CHERRY_APP_SECRET' , None )
165+ project_key = getattr (settings , 'CHERRY_PROJECT_KEY' , None )
165166
166167 if not app_secret :
167168 logger .error ("CHERRY_APP_SECRET is not configured on the backend settings." )
@@ -198,8 +199,11 @@ def post(self, request):
198199 members .append (owner_wallet )
199200
200201 # Call Cherry API with the correct endpoint URL
202+ if not project_key :
203+ logger .warning ("CHERRY_PROJECT_KEY is not configured on the backend. Group creation will likely fail." )
204+ auth_token = project_key if project_key else app_secret
201205 headers = {
202- 'Authorization' : f'Bearer { app_secret } ' ,
206+ 'Authorization' : f'Bearer { auth_token } ' ,
203207 'Content-Type' : 'application/json'
204208 }
205209 payload_cherry = {
You can’t perform that action at this time.
0 commit comments