MCPcopy Index your code
hub / github.com/Flagsmith/flagsmith / validate

Method validate

api/users/serializers.py:39–43  ·  view source on GitHub ↗
(self, attrs)

Source from the content-addressed store, hash-verified

37 return user
38
39 def validate(self, attrs): # type: ignore[no-untyped-def]
40 if not FFAdminUser.objects.filter(pk=attrs.get("id")).exists():
41 message = "User with id %d does not exist" % attrs.get("id")
42 raise ValidationError({"id": message})
43 return attrs
44
45 def _get_user(self, validated_data): # type: ignore[no-untyped-def]
46 try:

Callers

nothing calls this directly

Calls 2

existsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected