diff --git a/src/Makefile b/src/Makefile index 4f141d0..2b83f75 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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!" diff --git a/src/scrapper/spiders/slot_spider.py b/src/scrapper/spiders/slot_spider.py index 64cb4de..f18bcdb 100644 --- a/src/scrapper/spiders/slot_spider.py +++ b/src/scrapper/spiders/slot_spider.py @@ -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"])