"""
python scripts/populate_db.py
"""

import os
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../')


from timemanager.views.user_api import DAO as user_dao


users = [
    {
        'username': 'avi',
        'full_name': 'avi',
        'email': '<EMAIL>',
        'password': '<PASSWORD>',
        'is_admin': False,
        'is_manager': False
    },
    {
        'username': 'avi_admin',
        'full_name': '<NAME>',
        'email': '<EMAIL>',
        'password': '<PASSWORD>',
        'is_admin': True,
        'is_manager': False
    },
    {
        'username': 'avi_manager',
        'full_name': '<NAME>',
        'email': '<EMAIL>',
        'password': '<PASSWORD>',
        'is_admin': False,
        'is_manager': True
    },
]

for user in users:
    try:
        user_dao.create(user)
        print('Created user: %s' % user)
    except Exception as e:
        print('Error while creating: %s' % e)

"""
python scripts/populate_db.py
"""

import os
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../')


from timemanager.views.user_api import DAO as user_dao


users = [
    {
        'username': 'avi',
        'full_name': 'avi',
        'email': '<EMAIL>',
        'password': '<PASSWORD>',
        'is_admin': False,
        'is_manager': False
    },
    {
        'username': 'avi_admin',
        'full_name': '<NAME>',
        'email': '<EMAIL>',
        'password': '<PASSWORD>',
        'is_admin': True,
        'is_manager': False
    },
    {
        'username': 'avi_manager',
        'full_name': '<NAME>',
        'email': '<EMAIL>',
        'password': '<PASSWORD>',
        'is_admin': False,
        'is_manager': True
    },
]

for user in users:
    try:
        user_dao.create(user)
        print('Created user: %s' % user)
    except Exception as e:
        print('Error while creating: %s' % e)

python scripts/populate_db.py