mirror of
				https://github.com/avatao-content/test-tutorial-framework
				synced 2025-11-04 05:12:54 +00:00 
			
		
		
		
	Add docstrings to webservice UserOps class
This commit is contained in:
		@@ -9,6 +9,13 @@ class UserOps:
 | 
			
		||||
        self.password = password
 | 
			
		||||
 | 
			
		||||
    def authenticate(self):
 | 
			
		||||
        """
 | 
			
		||||
        Attempts to authenticate the user.
 | 
			
		||||
        Raises an exception on failure, does nothing on success.
 | 
			
		||||
 | 
			
		||||
        :raises InvalidCredentialsError:
 | 
			
		||||
            User does not exist or password provided is invalid
 | 
			
		||||
        """
 | 
			
		||||
        with Session() as db:
 | 
			
		||||
 | 
			
		||||
            user = db.query(User).filter(User.username == self.username).first()
 | 
			
		||||
@@ -17,6 +24,13 @@ class UserOps:
 | 
			
		||||
                raise InvalidCredentialsError
 | 
			
		||||
 | 
			
		||||
    def register(self):
 | 
			
		||||
        """
 | 
			
		||||
        Attempts to register a user.
 | 
			
		||||
        Raises an exception of failure, does nothing on success.
 | 
			
		||||
 | 
			
		||||
        :raises UserExistsError:
 | 
			
		||||
            A user with the provided username already exists
 | 
			
		||||
        """
 | 
			
		||||
        with Session() as db:
 | 
			
		||||
 | 
			
		||||
            if db.query(User).filter(User.username == self.username).all():
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user