#!/usr/bin/env python
"""Create a new admin user able to view the /reports endpoint."""
from getpass import getpass
import sys
from flask_bcrypt import Bcrypt
from WebApp import app

from dbFunctions import createUser

bcrypt = Bcrypt(app)


def main():
    print 'Enter username:',
    username = raw_input()
    password = getpass()
    assert password == getpass('Password (again):')
    createUser(username, bcrypt.generate_password_hash(password))
    print 'User added.'

if __name__ == '__main__':
    sys.exit(main())
d8d4256cc6878b80ee900ddcf80106e7e756aada
#!/usr/bin/env python
"""Create a new admin user able to view the /reports endpoint."""
from getpass import getpass
import sys
from flask_bcrypt import Bcrypt
from WebApp import app

from dbFunctions import createUser

bcrypt = Bcrypt(app)


def main():
    print 'Enter username:',
    username = raw_input()
    password = getpass()
    assert password == getpass('Password (again):')
    createUser(username, bcrypt.generate_password_hash(password))
    print 'User added.'

if __name__ == '__main__':
    sys.exit(main())