Importing lesson fails with , in subject name #52

Closed
opened 2022-05-06 09:37:33 +02:00 by nik · 4 comments
Owner
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/tasks.py", line 11, in _task
    import_command.run(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/commands.py", line 38, in run
    _untis_import_mysql(cls.get_terms(), version=version)
  File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/util/mysql/main.py", line 60, in untis_import_mysql
    import_lessons(
  File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/util/mysql/importers/lessons.py", line 98, in import_lessons
    class_ids = untis_split_third(el[17], conv=int)
IndexError: list index out of range

LessonElement2 begins with: 49~0~302~7r;~0;~0~0~175608~~~~~"Freiraum: Naturwissenschaften, Fokus Physik"~"Nawi"~~n~~;11;12;13;14;15;16;17;

The subject name contains a ,, which is used for splitting time data in the importer, so the entry is cut off here.

Probably, the parse should use a CSV parser for splitting in all cases instead of split.

```plain Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/celery/app/trace.py", line 451, in trace_task R = retval = fun(*args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/celery/app/trace.py", line 734, in __protected_call__ return self.run(*args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/tasks.py", line 11, in _task import_command.run(*args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/commands.py", line 38, in run _untis_import_mysql(cls.get_terms(), version=version) File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/util/mysql/main.py", line 60, in untis_import_mysql import_lessons( File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/untis/util/mysql/importers/lessons.py", line 98, in import_lessons class_ids = untis_split_third(el[17], conv=int) IndexError: list index out of range ``` `LessonElement2` begins with: `49~0~302~7r;~0;~0~0~175608~~~~~"Freiraum: Naturwissenschaften, Fokus Physik"~"Nawi"~~n~~;11;12;13;14;15;16;17;` The subject name contains a `,`, which is used for splitting time data in the importer, so the entry is cut off here. Probably, the parse should use a CSV parser for splitting in all cases instead of `split`.
Author
Owner

assigned to @hansegucker

assigned to @hansegucker
Owner

created branch 52-importing-lesson-fails-with-in-subject-name to address this issue

created branch [`52-importing-lesson-fails-with-in-subject-name`](/AlekSIS/official/AlekSIS-App-Untis/-/compare/master...52-importing-lesson-fails-with-in-subject-name) to address this issue
Owner

mentioned in merge request !219

mentioned in merge request !219
Author
Owner

mentioned in commit 2510ce6f86

mentioned in commit 2510ce6f8620e993092e892b19619942e49fbe7d
nik closed this issue 2022-05-24 21:10:39 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aleksis/AlekSIS-App-Untis#52
No description provided.