@@ -80,12 +80,12 @@ def get_context_data(self, **kwargs):
80
80
queryset = queryset .filter (source = params .get ("source" ))
81
81
if params .getlist ("assigned_to" ):
82
82
queryset = queryset .filter (
83
- assigned_to__id__in = json . loads ( params .get ("assigned_to" ) )
83
+ assigned_to__id__in = params .get ("assigned_to" )
84
84
)
85
85
if params .get ("status" ):
86
86
queryset = queryset .filter (status = params .get ("status" ))
87
87
if params .get ("tags" ):
88
- queryset = queryset .filter (tags__in = json . loads ( params .get ("tags" ) ))
88
+ queryset = queryset .filter (tags__in = params .get ("tags" ))
89
89
if params .get ("city" ):
90
90
queryset = queryset .filter (city__icontains = params .get ("city" ))
91
91
if params .get ("email" ):
@@ -165,7 +165,7 @@ def post(self, request, *args, **kwargs):
165
165
lead_obj = serializer .save (created_by = request .profile .user
166
166
, org = request .profile .org )
167
167
if data .get ("tags" ,None ):
168
- tags = json . loads ( data .get ("tags" ) )
168
+ tags = data .get ("tags" )
169
169
for t in tags :
170
170
tag = Tags .objects .filter (slug = t .lower ())
171
171
if tag .exists ():
@@ -176,7 +176,7 @@ def post(self, request, *args, **kwargs):
176
176
177
177
if data .get ("contacts" ,None ):
178
178
obj_contact = Contact .objects .filter (
179
- id__in = json . loads ( data .get ("contacts" ) ), org = request .profile .org
179
+ id__in = data .get ("contacts" ), org = request .profile .org
180
180
)
181
181
lead_obj .contacts .add (* obj_contact )
182
182
@@ -195,12 +195,12 @@ def post(self, request, *args, **kwargs):
195
195
attachment .save ()
196
196
197
197
if data .get ("teams" ,None ):
198
- teams_list = json . loads ( data .get ("teams" ) )
198
+ teams_list = data .get ("teams" )
199
199
teams = Teams .objects .filter (id__in = teams_list , org = request .profile .org )
200
200
lead_obj .teams .add (* teams )
201
201
202
202
if data .get ("assigned_to" ,None ):
203
- assinged_to_list = json . loads ( data .get ("assigned_to" ) )
203
+ assinged_to_list = data .get ("assigned_to" )
204
204
profiles = Profile .objects .filter (
205
205
id__in = assinged_to_list , org = request .profile .org
206
206
)
@@ -235,7 +235,7 @@ def post(self, request, *args, **kwargs):
235
235
account_object .tags .add (tag )
236
236
237
237
if data .get ("assigned_to" ,None ):
238
- assigned_to_list = json . loads ( data .getlist ("assigned_to" ) )
238
+ assigned_to_list = data .getlist ("assigned_to" )
239
239
recipients = assigned_to_list
240
240
send_email_to_assigned_user .delay (
241
241
recipients ,
@@ -438,7 +438,7 @@ def put(self, request, pk, **kwargs):
438
438
)
439
439
lead_obj .tags .clear ()
440
440
if params .get ("tags" ):
441
- tags = json . loads ( params .get ("tags" ) )
441
+ tags = params .get ("tags" )
442
442
# for t in tags:
443
443
# tag,_ = Tags.objects.get_or_create(name=t)
444
444
# lead_obj.tags.add(tag)
@@ -475,13 +475,13 @@ def put(self, request, pk, **kwargs):
475
475
476
476
lead_obj .teams .clear ()
477
477
if params .get ("teams" ):
478
- teams_list = json . loads ( params .get ("teams" ) )
478
+ teams_list = params .get ("teams" )
479
479
teams = Teams .objects .filter (id__in = teams_list , org = request .profile .org )
480
480
lead_obj .teams .add (* teams )
481
481
482
482
lead_obj .assigned_to .clear ()
483
483
if params .get ("assigned_to" ):
484
- assinged_to_list = json . loads ( params .get ("assigned_to" ) )
484
+ assinged_to_list = params .get ("assigned_to" )
485
485
profiles = Profile .objects .filter (
486
486
id__in = assinged_to_list , org = request .profile .org
487
487
)
@@ -516,7 +516,7 @@ def put(self, request, pk, **kwargs):
516
516
account_object .tags .add (tag )
517
517
if params .get ("assigned_to" ):
518
518
# account_object.assigned_to.add(*params.getlist('assigned_to'))
519
- assigned_to_list = json . loads ( params .get ("assigned_to" ) )
519
+ assigned_to_list = params .get ("assigned_to" )
520
520
recipients = assigned_to_list
521
521
send_email_to_assigned_user .delay (
522
522
recipients ,
0 commit comments