HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/buyercall/lib/__pycache__/db_seed.cpython-310.pyc
o

�we��@s�ddlZddlmZddlmZddlmZddlmZzddl	m
Z
e
jfZe
jZWn'e
y=e�d�ed�YneyRddlm
Z
e
jfZe
jZYnwd	d
�Zdd�Zd
d�Zdd�ZdS)�N)�User)�Report)�Partnership)�db)�settingsz:Ensure __init__.py and settings.py both exist in instance/�cCs2t�t�dur	dSdtddd�}tdi|����S)z>
    Create an admin account.

    :return: User instance
    N�sysadmin�password�SysAdmin)�role�emailr	�company�)r�find_by_identity�SEED_ADMIN_EMAIL�save)�paramsrr�7/home/arjun/projects/buyercall/buyercall/lib/db_seed.py�create_sysadmins�rcCs8tj�tjdk���durtdd�}tj�|�dSdS)z
    Create reports.
    zList of InterestN)�name)r�query�filterr�firstr�session�add)�reportrrr�create_reports*s
�rcCs�tj�tjdk���}|durt�}d|_d|_tj�|�|durKt	j�t	j
dkt	j�d����durMdt
dd|d�}t	d	i|��}tj�|�dSdSdS)
z!
        Create partnership.
    �	BuyercallN�accountzBuyercall PartnershipF�partnerr	)rrr	r
�partnershipr)rrrrr�default_billing_typerrrrr
�is_deactivated�is_�SEED_PARTNER_EMAIL)r rrrrr�create_partnership3s ,��r%cCs t�t�t�tj��dS)zW
    Entry point to seed the database with whatever we see fit.

    :return: None
    N)rrr%rr�commitrrrr�
seed_databaseKs

r')�logging� buyercall.blueprints.user.modelsr�#buyercall.blueprints.reports.modelsr�'buyercall.blueprints.partnership.modelsr�buyercall.extensionsr�instancerrr$�ImportError�error�exit�AttributeError�configrrr%r'rrrr�<module>s*


�