-
Notifications
You must be signed in to change notification settings - Fork 3
/
confirm.py
49 lines (35 loc) · 1.26 KB
/
confirm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- encoding: utf-8 -*-
from flask import current_app
from flask.ext.script import Command
from werkzeug.local import LocalProxy
__all__ = ['Confirm']
mongo = LocalProxy(lambda: current_app.extensions['mongoset'])
class Confirm(Command):
def run(self):
print "Send confirmation email"
return
'''
# self.create_roles()
# self.create_user()
data = user_data
name = raw_input("Enter First and Last name: ")
first_name, last_name = name.split(" ", 1)
_email = raw_input("Enter email: ")
_name, email = parseaddr(_email)
if not email:
raise ValueError("Please, enter valid email")
password = getpass.getpass("Enter password: ")
password1 = getpass.getpass("Repeat password: ")
if not password:
raise ValueError("Please, enter non-empty password")
if password != password1:
raise ValueError("Password doesn't match")
data.update(dict(
password=password,
email=email,
first_name=first_name,
last_name=last_name))
self.create_admin_user(data).save()
_security.datastore.commit()
print "User `{}` have been added".format(email)
'''