gbmodel/model_sqlalchemy.py
def check_dup_session(self, s_term, s_year, p_id):
        """
        Check if the new session name already exists in the database
        Input: start term & year of the new session
        Output: return False if the team already exists, True otherwise
        """
        try:
            s_term = s_term.strip().lower().capitalize()
            s_year = s_year.strip().lower().capitalize()
            p_id = p_id.strip().lower()
            result = capstone_session().query.filter_by(
                start_term=s_term, start_year=s_year, professor_id=p_id).first()
        except exc.SQLAlchemyError:
            handle_exception()
            result = None

        if result is not None:
            return False
        return True

        Check if the new session name already exists in the database
        Input: start term & year of the new session
        Output: return False if the team already exists, True otherwise
        
Check if the new session name already exists in the database
Input: start term & year of the new session
Output: return False if the team already exists, True otherwise
Check if the new session name already exists in the database Input : start term & year of the new session Output : return False if the team already exists True otherwise
def check_dup_session(self, s_term, s_year, p_id):
        try:
            s_term = s_term.strip().lower().capitalize()
            s_year = s_year.strip().lower().capitalize()
            p_id = p_id.strip().lower()
            result = capstone_session().query.filter_by(
                start_term=s_term, start_year=s_year, professor_id=p_id).first()
        except exc.SQLAlchemyError:
            handle_exception()
            result = None
        if result is not None:
            return False
        return True
def check_dup_session ( self , s_term , s_year , p_id ) : try : s_term = s_term . strip ( ) . lower ( ) . capitalize ( ) s_year = s_year . strip ( ) . lower ( ) . capitalize ( ) p_id = p_id . strip ( ) . lower ( ) result = capstone_session ( ) . query . filter_by ( start_term = s_term , start_year = s_year , professor_id = p_id ) . first ( ) except exc . SQLAlchemyError : handle_exception ( ) result = None if result is not None : return False return True
Check if the new session name already exists in the database
Input: start term & year of the new session
Output: return False if the team already exists, True otherwise
Check if the new session name already exists in the database Input : start term & year of the new session Output : return False if the team already exists True otherwise
"""
        Check if the new session name already exists in the database
        Input: start term & year of the new session
        Output: return False if the team already exists, True otherwise
        """
self
s_term
s_year
p_id