Пример #1
0
 def save(self):
     person_id = self.cleaned_data['person_id']
     roles = self.cleaned_data['roles']
     for role in roles:
         PersonService.detach_role(person_id=person_id, role_id=role.id)
Пример #2
0
 def delete(self, request: HttpRequest, person_id: str, role_id: str):
     person_id = self.parse_int_pk(person_id)
     role_id = self.parse_int_pk(role_id)
     PersonService.detach_role(person_id, role_id)
     return ApiResponse.success()
Пример #3
0
 def save(self):
     role_id = self.cleaned_data[ROLE_ID]
     persons = self.cleaned_data[PERSONS]
     for person in persons:
         PersonService.detach_role(person_id=person.id, role_id=role_id)