MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / validate_unique_user

Function validate_unique_user

web/pgadmin/tools/user_management/__init__.py:589–600  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

587
588
589def validate_unique_user(data):
590 if 'username' not in data:
591 return
592
593 exist_users = User.query.filter_by(
594 username=data['username'],
595 auth_source=data['auth_source']
596 ).count()
597
598 if exist_users != 0:
599 raise InternalServerError(_("User email or username must be unique "
600 "for each authentication source."))
601
602
603def validate_user(data):

Callers 1

validate_userFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected