GetToken Debuged
This commit is contained in:
@@ -230,16 +230,17 @@ class GetDeviceToken(APIView):
|
||||
data = request.data
|
||||
sis = Sistema.objects.get(nombre_sistema=data.get('sistema'))
|
||||
cli = Clientes.objects.get(RFC=data.get('client'))
|
||||
print('cli.id',cli.id)
|
||||
device = Device.objects.filter(
|
||||
Q(client=cli.id)
|
||||
#& Q(device_name=data.get('device_name'))
|
||||
#& Q(ip_address=data.get('ip_address'))
|
||||
#& Q(sistema= int(sis.id))
|
||||
#& Q(macAddress__icontains=data.get('macAddress'))
|
||||
mac_address = data.get('macAddress')
|
||||
|
||||
device = Device.objects.filter(
|
||||
Q(client__id=cli.id)
|
||||
& Q(macAddress=data.get('macAddress'))
|
||||
& Q(device_name__icontains=data.get('device_name'))
|
||||
& Q(ip_address__icontains=data.get('ip_address'))
|
||||
& Q(sistema__id= sis.id)
|
||||
).first()
|
||||
|
||||
print('device',device)
|
||||
|
||||
if device is not None:
|
||||
token = {"token":str(device.token)}
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user