Skip to content
Snippets Groups Projects
Verified Commit 24d8fb2e authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix error handling and messages in move_dates_for_testing

parent 5536f59b
No related branches found
No related tags found
1 merge request!100Resolve "move_dates_for_testing throws misleading errors"
......@@ -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",
......
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