Island: Add docstrings to Registration resource

This commit is contained in:
Shreya Malviya 2022-08-02 14:45:31 +05:30
parent 9f02fd4e44
commit ac34eb56e9
1 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,9 @@ logger = logging.getLogger(__name__)
class Registration(AbstractResource): class Registration(AbstractResource):
"""
A resource for user registration
"""
urls = ["/api/register"] urls = ["/api/register"]
@ -19,6 +22,14 @@ class Registration(AbstractResource):
self._authentication_service = authentication_service self._authentication_service = authentication_service
def post(self): def post(self):
"""
Gets a username and password from the request sent from the client,
and registers a new user
:raises InvalidRegistrationCredentialsError: If username or password is empty
:raises AlreadyRegisteredError: If a user has already been registered
"""
username, password = get_username_password_from_request(request) username, password = get_username_password_from_request(request)
try: try: