MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / delete

Method delete

apps/users/serializers/user.py:474–481  ·  view source on GitHub ↗
(self, with_valid=True)

Source from the content-addressed store, hash-verified

472
473 @transaction.atomic
474 def delete(self, with_valid=True):
475 if with_valid:
476 self.is_valid(raise_exception=True)
477 self._check_not_admin()
478 user_id = self.data.get('id')
479 # TODO 需要删除授权关系
480 User.objects.filter(id=user_id).delete()
481 return True
482
483 def _check_not_admin(self):
484 user = User.objects.filter(id=self.data.get('id')).first()

Callers 5

batch_deleteMethod · 0.45
update_user_roleFunction · 0.45
reset_passwordMethod · 0.45
sendMethod · 0.45
loginMethod · 0.45

Calls 3

is_validMethod · 0.95
_check_not_adminMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected