Skip to content
Snippets Groups Projects
Commit 716752fd authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'fix/set-comment-revision' into 'master'

Set comment in revision to attribute the deletion to the importer

See merge request !44
parents 141431be 45b0a726
No related branches found
No related tags found
1 merge request!44Set comment in revision to attribute the deletion to the importer
Pipeline #4823 passed
...@@ -4,6 +4,7 @@ from django.db.models import Q ...@@ -4,6 +4,7 @@ from django.db.models import Q
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
import reversion import reversion
from reversion import set_comment
from tqdm import tqdm from tqdm import tqdm
from aleksis.apps.chronos import models as chronos_models from aleksis.apps.chronos import models as chronos_models
...@@ -262,5 +263,6 @@ def import_lessons( ...@@ -262,5 +263,6 @@ def import_lessons(
if lesson.lesson_id_untis and lesson.lesson_id_untis not in existing_lessons: if lesson.lesson_id_untis and lesson.lesson_id_untis not in existing_lessons:
logger.info("Lesson {} deleted".format(lesson.id)) logger.info("Lesson {} deleted".format(lesson.id))
with reversion.create_revision(): with reversion.create_revision():
set_comment(_("Deleted by UNTIS import"))
lesson.save() lesson.save()
lesson.delete() lesson.delete()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment