|
4 | 4 | # --- BEGIN_HEADER --- |
5 | 5 | # |
6 | 6 | # reqoidaction - handle OpenID account requests and send email to admins |
7 | | -# Copyright (C) 2003-2023 The MiG Project lead by Brian Vinter |
| 7 | +# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH |
8 | 8 | # |
9 | 9 | # This file is part of MiG. |
10 | 10 | # |
|
37 | 37 |
|
38 | 38 | from mig.shared import returnvalues |
39 | 39 | from mig.shared.accountreq import existing_country_code, forced_org_email_match, \ |
40 | | - user_manage_commands, save_account_request |
| 40 | + prefilter_potential_peers, user_manage_commands, save_account_request |
41 | 41 | from mig.shared.accountstate import default_account_expire |
42 | 42 | from mig.shared.base import client_id_dir, canonical_user, mask_creds, \ |
43 | 43 | force_utf8, force_unicode, force_native_str, force_native_str_rec, \ |
@@ -198,6 +198,21 @@ def main(client_id, user_arguments_dict): |
198 | 198 | 'class': 'genericbutton', 'text': "Try again"}) |
199 | 199 | return (output_objects, returnvalues.CLIENT_ERROR) |
200 | 200 |
|
| 201 | + peers_list = [] |
| 202 | + for (peer_name, peer_email) in zip(peers_full_name_list, peers_email_list): |
| 203 | + peers_list.append({'full_name': peer_name, 'email': peer_email}) |
| 204 | + valid_peers = prefilter_potential_peers(peers_list, configuration) |
| 205 | + if not valid_peers: |
| 206 | + output_objects.append({'object_type': 'error_text', 'text': |
| 207 | + '''Invalid peers specification: |
| 208 | +Please read and follow the sign up help and instructions on the request page! |
| 209 | +You may also read more about the Peers system in the site documentation. |
| 210 | +'''}) |
| 211 | + output_objects.append( |
| 212 | + {'object_type': 'link', 'destination': 'javascript:history.back();', |
| 213 | + 'class': 'genericbutton', 'text': "Try again"}) |
| 214 | + return (output_objects, returnvalues.CLIENT_ERROR) |
| 215 | + |
201 | 216 | # TODO: move this check to conf? |
202 | 217 |
|
203 | 218 | if not forced_org_email_match(org, email, configuration): |
|
0 commit comments