mirror of
https://github.com/quay/quay.git
synced 2026-01-26 06:21:37 +03:00
* chore: drop deprecated tables and remove unused code * isort imports * migration: check for table existence before drop
26 lines
713 B
Python
26 lines
713 B
Python
import argparse
|
|
|
|
from flask import Flask, current_app
|
|
|
|
from app import app
|
|
from data import model
|
|
from util.useremails import send_confirmation_email
|
|
|
|
|
|
def sendConfirmation(username):
|
|
user = model.user.get_nonrobot_user(username)
|
|
if not user:
|
|
print("No user found")
|
|
return
|
|
|
|
with app.app_context():
|
|
confirmation_code = model.user.create_confirm_email_code(user)
|
|
send_confirmation_email(user.username, user.email, confirmation_code)
|
|
print("Email sent to %s" % (user.email))
|
|
|
|
|
|
parser = argparse.ArgumentParser(description="Sends a confirmation email")
|
|
parser.add_argument("username", help="The username")
|
|
args = parser.parse_args()
|
|
sendConfirmation(args.username)
|