o
    i                     @  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/admin_password_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   admin_account_idinttokenpurposepassword_hashc              	   C  s`   t  #}|dt| t|t|t|f}|  t|jW  d    S 1 s)w   Y  d S )Nz
            INSERT INTO admin_password_updates(
                admin_account_id,
                token,
                purpose,
                password_hash,
                status
            )
            VALUES (?, ?, ?, ?, 'pending')
            )r   executer   r   commit	lastrowid)r   r   r   r   r   curr	   r	   r
   create_admin_password_update   s   
$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   

