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]]:
20
20
text (
21
21
"SELECT job_id, agency, business_title, \
22
22
salary_range_from, salary_range_to \
23
- FROM nyc_jobs ORDER BY RAND();"
23
+ FROM nyc_jobs ORDER BY RAND() LIMIT 10 ;"
24
24
)
25
25
)
26
26
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:
41
41
:return: Optional[User]
42
42
"""
43
43
try :
44
- user_query = session .query (User ).all ()
44
+ user_query = session .query (User ).filter ( User . username == user . username ). first ()
45
45
if user_query is None :
46
46
session .add (user ) # Add the user
47
47
session .commit () # Commit the change
You can’t perform that action at this time.
0 commit comments