o
    #pg                     @   s   d dl Z d dlmZ d dlmZ d dlmZ d dlmZm	Z	 d dl
mZmZ d dlmZ d dlmZ d d	lmZ d d
lmZ edd ZdS )    N)	urlencode)cache)	serialize)HttpResponseJsonResponse)renderredirect)csrf_exempt)Response)	Customers)CustomerSerializerc                 C   sX   zt jj|d}t|d| id}|j}t|ddW S  t jy+   tddidd	 Y S w )
N)qr_coderequest)contextF)safeerrorzCustomer not foundi  )status)r   objectsgetr   datar   DoesNotExist)r   r   qr_scan
serializercustomer_data r   >/var/www/rescue_company/customer_api/views/customer_qr_code.pyinitial_scan   s   r   )jsonurllib.parser   django.core.cacher   django.core.serializersr   django.httpr   r   django.shortcutsr   r   django.views.decorators.csrfr	   rest_framework.responser
   accounts.modelsr   +customer_api.serializers.CustomerSerializerr   r   r   r   r   r   <module>   s    