Commit e26bc7ca authored by Kostas Papadimitriou's avatar Kostas Papadimitriou

astakos: Allow admin to verify user from command line

using the new option `--verify` added in `user-modify` command
parent 324d2797
......@@ -114,6 +114,10 @@ class Command(BaseCommand):
dest='accept',
action='store_true',
help="Accept user"),
make_option('--verify',
dest='verify',
action='store_true',
help="Verify user email"),
make_option('--reject',
dest='reject',
action='store_true',
......@@ -169,6 +173,16 @@ class Command(BaseCommand):
else:
print "Account rejected"
if options.get('verify'):
res = activation_backend.handle_verification(
user,
user.verification_code)
#activation_backend.send_result_notifications(res, user)
if res.is_error():
print "Failed to verify.", res.message
else:
print "Account verified (%s)" % res.status_display()
if options.get('accept'):
res = activation_backend.handle_moderation(user, accept=True)
activation_backend.send_result_notifications(res, user)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment