zesje issueshttps://gitlab.kwant-project.org/zesje/zesje/-/issues2023-04-14T09:15:46Zhttps://gitlab.kwant-project.org/zesje/zesje/-/issues/681Catch errors in uploaded csv2023-04-14T09:15:46ZAnton AkhmerovCatch errors in uploaded csvTrying to upload an invalid csv results in a 500 with this error.
```
Traceback (most recent call last):
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispa...Trying to upload an invalid csv results in a 500 with this error.
```
Traceback (most recent call last):
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask_restful/__init__.py", line 467, in wrapper
resp = resource(*args, **kwargs)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/views.py", line 84, in view
return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
resp = meth(*args, **kwargs)
File "/app/zesje/api/students.py", line 136, in post
student = _row_to_student(row)
File "/app/zesje/api/students.py", line 175, in _row_to_student
first_name=row['First Name'],
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/pandas/core/series.py", line 981, in __getitem__
return self._get_value(key)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/pandas/core/series.py", line 1089, in _get_value
loc = self.index.get_loc(label)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc
raise KeyError(key) from err
KeyError: 'First Name'
```
we catch it and be more informativehttps://gitlab.kwant-project.org/zesje/zesje/-/issues/624Implement an instance overview page2022-03-30T14:54:09ZAnton AkhmerovImplement an instance overview pageWe should move the docs to zesje.tudelft.nl, and use the landing page to show an overview info about the course.
It should also guide the user to different option.We should move the docs to zesje.tudelft.nl, and use the landing page to show an overview info about the course.
It should also guide the user to different option.https://gitlab.kwant-project.org/zesje/zesje/-/issues/499Link zesje project website from the app & move the docs there2022-03-30T15:21:24ZAnton AkhmerovLink zesje project website from the app & move the docs therehttps://gitlab.kwant-project.org/zesje/zesje/-/issues/481Split import and processing pipeline2022-06-03T14:31:32ZHugo KerstensSplit import and processing pipelineWhen a user uploads a file:
1. We save the file to the disk, create a `Scan` entry, and start the importing task.
2. In the importing task, we extract every image we can find in the file. We store this image information the `Image` table...When a user uploads a file:
1. We save the file to the disk, create a `Scan` entry, and start the importing task.
2. In the importing task, we extract every image we can find in the file. We store this image information the `Image` table, containing: `path`, `origin`, `status` and `scan_id`.
3. After the import task is finished, we start the processing task for the `scan_id`.
4. The processing task reads all `Image` entries from the database, and processes them according to `status`, creating `Page` entries in the process.
The `Image` table:
- `id`: primary key
- `path`: path to the image on disk
- `origin`: path to the image in the original scan file
- `status`: one of `normal`, `raw`, `failed`.
- `scan_id`: points to the scan
The `Page` table:
- Add `image_id`
- Remove `path`
We can deduce what to do with an `Image` the following way (related to #455):
- The status `normal`/`raw` without a `Page` entry means: waiting for processing with the normal/raw pipeline.
- The status `normal` with a `Page` entry means: processed successfully with the normal pipeline, immutable.
- The status `raw` with a `Page` entry means: processed successfully with the raw pipeline, we still allow assigning a different student, page and copy manually.
- The status `failed` without a `Page` entry indicates the user can either manually assign student, page and copy, or delete the image altogether.Image Processing Pipeline