| 322 | object_type = ValidObjectTypes.project |
| 323 | ) |
| 324 | def remove_auth_api(self): |
| 325 | |
| 326 | auth_api = self.member_to_modify.auth_api |
| 327 | |
| 328 | if auth_api is None: |
| 329 | self.log['error']['auth_api'] = "No valid auth api attached to this member" |
| 330 | return |
| 331 | |
| 332 | if auth_api.project != self.project: |
| 333 | self.log['error']['auth_api'] = "Permission error, check auth is related to project." |
| 334 | return |
| 335 | |
| 336 | if auth_api.is_valid == False: |
| 337 | self.log['error']['auth_api'] = "Is already not valid." |
| 338 | return |
| 339 | |
| 340 | # TODO share deletion thing? maybe record member instead of auth_api id? |
| 341 | deletion = Deletion(project = self.project, |
| 342 | member_created = self.user_who_made_request.member, |
| 343 | mode = 'remove_auth_api') |
| 344 | self.session.add(deletion) |
| 345 | deletion.cache = {} |
| 346 | deletion.cache['auth_api_id'] = auth_api.id |
| 347 | |
| 348 | auth_api.is_valid = False |
| 349 | self.session.add(auth_api) |
| 350 | |
| 351 | def remove_user(self): |
| 352 | """ |