diff --git a/hblink-SAMPLE.cfg b/hblink-SAMPLE.cfg index 79d3da1..a0160cd 100755 --- a/hblink-SAMPLE.cfg +++ b/hblink-SAMPLE.cfg @@ -121,7 +121,7 @@ EXTRA_2: DmR4 # Secret used to authenticate with user managment server, before checking if user login is approved SHARED_SECRET: test # Shorten passphrases -SHORTEN_PASSPHRASE: False +SHORTEN_PASSPHRASE: True SHORTEN_SAMPLE: 4 SHORTEN_LENGTH: 4 BURN_FILE: ./burn_ids.txt diff --git a/web/app.py b/web/app.py index bc0e147..2df1620 100644 --- a/web/app.py +++ b/web/app.py @@ -607,6 +607,7 @@ def create_app(): def _after_user_registered_hook(sender, user, **extra): edit_user = User.query.filter(User.username == user.username).first() radioid_data = ast.literal_eval(get_ids(user.username)) +## edit_user.notes = '' edit_user.dmr_ids = str(radioid_data[0]) edit_user.first_name = str(radioid_data[1]) edit_user.last_name = str(radioid_data[2]) @@ -1131,12 +1132,15 @@ def create_app(): edit_user.initial_admin_approved = True db.session.commit() email_text = Misc.query.filter_by(field_1='approval_email').first() - msg = Message(recipients=[edit_user.email], - sender=(title, MAIL_DEFAULT_SENDER), - subject='Account Approval', - body = str(email_text.field_2)) - mail.send(msg) - content = '''

User approved: ''' + str(request.args.get('callsign')) + '''

\n''' + try: + msg = Message(recipients=[edit_user.email], + sender=(title, MAIL_DEFAULT_SENDER), + subject='Account Approval', + body = str(email_text.field_2)) + mail.send(msg) + except: + content = 'Failed to send email. Approved user anyway' + content = content + '''

User approved: ''' + str(request.args.get('callsign')) + '''

\n''' elif request.method == 'GET' and request.args.get('callsign') and request.args.get('email_verified') == 'true': edit_user = User.query.filter(User.username == request.args.get('callsign')).first() @@ -1150,8 +1154,9 @@ def create_app(): if request.form.get('callsign'): callsign = request.form.get('callsign') u = User.query.filter_by(username=callsign).first() - if u.notes == None: - user_notes = '' + user_email_address = 'None' + if str(u.email): + user_email_address = str(u.email) confirm_link = '' if u.email_confirmed_at == None: confirm_link = '''

Verify email - ''' + str(u.username) + '''

\n''' @@ -1171,7 +1176,7 @@ def create_app(): Passphrase ''' for i in id_dict.items(): - print(i[1]) +## print(i[1]) if isinstance(i[1], int) == True: passphrase_list = passphrase_list + ''' @@ -1260,7 +1265,7 @@ def create_app():
-
+
@@ -1283,7 +1288,7 @@ def create_app(): -


+