in name of god 2.0

This commit is contained in:
fjrodriguez
2023-04-12 09:20:07 -06:00
parent 42fef321e9
commit e192920a5d
5 changed files with 45 additions and 12 deletions

View File

@@ -233,14 +233,16 @@ class GetDeviceToken(APIView):
device_name= data.get('device_name')
ip_address = data.get('ip_address')
macAddress = data.get('macAddress')
database = data.get('database')
username_ = f"Device_{cli.RFC}_{device_name}_{ip_address}_{macAddress}"
username_ = re.sub(r'\W+', '', username_)
print(username_)
device = Device.objects.filter(
username__username__icontains=username_
username__username__icontains=username_,
database=database
).first()
print('device',device)
if device is not None:
token = {"token":str(device.token)}
else: