Skip to content

Commit

Permalink
fix: teacher id is now never a string
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaspalma committed Aug 14, 2024
1 parent 201101a commit e7bcb29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ upload:
@python ./scripts/upload.py
@echo "Upload completed!"

convert_mysql:
@echo "Converting dump to mysql..."
convert_postgres:
@echo "Converting dump to postgres..."
@bash ./scripts/sqlite3-to-mysql.sh ./scripts/dump/data/dump_sqlite3.sql > ./scripts/dump/data/01_data.sql
@echo "Convertion completed!"

Expand Down
7 changes: 6 additions & 1 deletion src/scrapper/spiders/slot_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ def get_professor_info(self, teacher):
[professor_sigarra_id, professor_name,
*_] = teacher["name"].split("-", 1)

return (professor_sigarra_id.strip(), professor_name.strip())
try:
professor_sigarra_id = int(professor_sigarra_id.strip())
except:
professor_sigarra_id = teacher["id"]

return (professor_sigarra_id, professor_name.strip())

return (teacher["sigarra_id"], teacher["name"])

0 comments on commit e7bcb29

Please sign in to comment.