File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def fetch_job_listings(engine: Engine) -> Optional[List[dict]]:
2020 text (
2121 "SELECT job_id, agency, business_title, \
2222 salary_range_from, salary_range_to \
23- FROM nyc_jobs ORDER BY RAND();"
23+ FROM nyc_jobs ORDER BY RAND() LIMIT 10 ;"
2424 )
2525 )
2626 rows = [dict (row ) for row in result .fetchall ()]
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def create_new_user(session: Session, user: User) -> User:
4141 :return: Optional[User]
4242 """
4343 try :
44- user_query = session .query (User ).all ()
44+ user_query = session .query (User ).filter ( User . username == user . username ). first ()
4545 if user_query is None :
4646 session .add (user ) # Add the user
4747 session .commit () # Commit the change
You can’t perform that action at this time.
0 commit comments