in name of god 2.0
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user