Lerndatenbank/lernplattform/classes.py

28 lines
1.0 KiB
Python
Raw Normal View History

from flask import Flask, request
from lernplattform import app
from lernplattform.models import User
class login():
"""
A class for handling user login functionality.
Attributes:
user_name (str): The username to be checked for authentication.
Methods:
__init__(self, user_name=None): Initializes the login object with a given user name.
check(user_name): A static method that checks if the provided user name is valid.
login(self): Prints "Login" to indicate that the login method has been called.
"""
def __init__(self, user_name=None):
self.user_name = user_name # Initialize the user name attribute for the login class
@staticmethod
def check(user_name):
if user_name is None:
return False # Return False if the user name is not provided
else:
return True # Otherwise, return True indicating a valid user name
def login(self):
print("Login") # Print "Login" to indicate that the login method has been called