| 224 | confirm = StringField(_l("Confirmation"), validators=[DataRequired()]) |
| 225 | |
| 226 | def __init__( |
| 227 | self, request: Request, *args, associations: list["StorageProject"], **kwargs |
| 228 | ): |
| 229 | super().__init__(request, *args, **kwargs) |
| 230 | self.associations = associations |
| 231 | self._associations_by_id = { |
| 232 | str(association.id): association for association in associations |
| 233 | } |
| 234 | self.association = None |
| 235 | |
| 236 | def validate_association_id(self, field): |
| 237 | association = self._associations_by_id.get(field.data) |