diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 97b5878ceaeebde33bcfe65013dce37e710b2073..5230f1dd154ea500ba9f786c1453d59023c3f33e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,7 @@ Fixed ~~~~~ * Import failed if there were classes without class teachers. +* Management command ``move_dates_for_testing`` throwed misleading errors. `2.0`_ - 2021-10-30 ------------------- diff --git a/aleksis/apps/untis/management/commands/move_dates_for_testing.py b/aleksis/apps/untis/management/commands/move_dates_for_testing.py index e98cbc59ebc0c38e60c86bafe8c55b33cf6bb4d7..3443b163e71ab65bb67ef019c829839e07e257a1 100644 --- a/aleksis/apps/untis/management/commands/move_dates_for_testing.py +++ b/aleksis/apps/untis/management/commands/move_dates_for_testing.py @@ -65,7 +65,7 @@ class Command(BaseCommand): school_terms = SchoolTerm.objects.order_by("-date_end") if not school_terms.exists(): - raise RuntimeError("No validity range available.") + raise RuntimeError("No school term available.") school_term = school_terms.first() self.stdout.write(f"Used school term: {school_term}") @@ -90,7 +90,8 @@ class Command(BaseCommand): ) if not self.weeks: - raise RuntimeError("You need at least one validity range to move data.") + self.stdout.write(self.style.ERROR("There are no data that have to be moved.")) + return self.translate_week_year( "SUBSTITUTIONS",