o
    ij                     @  s>   d dl mZ d dlZd dlZdddZddd	ZdddZdS )    )annotationsNreturnstrc                   C  s   t jddS )NTWM_AUTH_DB_PATHz./home/cpsweather/theweathermonitor.com/auth.db)osenvironget r	   r	   'auth_app/recipient_prefs_update_repo.py_db_path   s   r   sqlite3.Connectionc                  C  s   t jt dd} t j| _| S )Ng      @)timeout)sqlite3connectr   Rowrow_factory)cxr	   r	   r
   _connect   s   r   token_idintuser_idtokenemail_enabledsms_enabledc              
   C  sf   t  &}|dt| t|t|t|t|f}|  t|jW  d    S 1 s,w   Y  d S )Na  
            INSERT INTO recipient_preferences_updates(
                token_id,
                user_id,
                token,
                email_enabled,
                sms_enabled,
                status
            )
            VALUES (?, ?, ?, ?, ?, 'pending')
            )r   executer   r   commit	lastrowid)r   r   r   r   r   r   curr	   r	   r
   #create_recipient_preferences_update   s   $r   )r   r   )r   r   )r   r   r   r   r   r   r   r   r   r   r   r   )
__future__r   r   r   r   r   r   r	   r	   r	   r
   <module>   s   

