Mercurial > libervia-website
comparison pages/association/membership/page_meta.py @ 22:5fd933e238bb
massive refactoring from camelCase -> snake_case. See backend commit log for more details
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 22 May 2023 09:11:54 +0200 |
parents | 67487063f421 |
children | 395af2ad2bc9 |
comparison
equal
deleted
inserted
replaced
21:67487063f421 | 22:5fd933e238bb |
---|---|
62 WARNING_MSG_MISSING_FIELDS = D_( | 62 WARNING_MSG_MISSING_FIELDS = D_( |
63 "The form you posted is not complete, we can't validate this membership request.\n" | 63 "The form you posted is not complete, we can't validate this membership request.\n" |
64 "Please fill all the required fields, thank you!") | 64 "Please fill all the required fields, thank you!") |
65 | 65 |
66 async def on_data_post(self, request): | 66 async def on_data_post(self, request): |
67 data = FormData(*self.getPostedData(request, FIELDS, raise_on_missing=False)) | 67 data = FormData(*self.get_posted_data(request, FIELDS, raise_on_missing=False)) |
68 if any(not getattr(data, f) for f in REQUIRED): | 68 if any(not getattr(data, f) for f in REQUIRED): |
69 log.warning("missing data fields:\n{data}".format(data=data)) | 69 log.warning("missing data fields:\n{data}".format(data=data)) |
70 raise exceptions.DataError(WARNING_MSG_MISSING_FIELDS) | 70 raise exceptions.DataError(WARNING_MSG_MISSING_FIELDS) |
71 if not C.bool(data.documents_read or C.BOOL_FALSE): | 71 if not C.bool(data.documents_read or C.BOOL_FALSE): |
72 log.warning("documents_read has not been checked:\n{data}".format(data=data)) | 72 log.warning("documents_read has not been checked:\n{data}".format(data=data)) |
73 raise exceptions.DataError(WARNING_MSG_NOT_READ) | 73 raise exceptions.DataError(WARNING_MSG_NOT_READ) |
74 addresses = config.getConfig( | 74 addresses = config.config_get( |
75 self.host.main_conf, | 75 self.host.main_conf, |
76 None, | 76 None, |
77 "email_admins_list", | 77 "email_admins_list", |
78 default=Exception) | 78 default=Exception) |
79 await email.sendEmail( | 79 await email.send_email( |
80 self.host.main_conf, | 80 self.host.main_conf, |
81 addresses, | 81 addresses, |
82 SUBJECT_ADMIN, | 82 SUBJECT_ADMIN, |
83 BODY_ADMIN.format(**data._asdict()), | 83 BODY_ADMIN.format(**data._asdict()), |
84 ) | 84 ) |
85 await email.sendEmail( | 85 await email.send_email( |
86 self.host.main_conf, | 86 self.host.main_conf, |
87 data.email, | 87 data.email, |
88 SUBJECT, | 88 SUBJECT, |
89 BODY.format(**data._asdict()), | 89 BODY.format(**data._asdict()), |
90 ) | 90 ) |