Skip to content

Commit

Permalink
Fix export reservation units command
Browse files Browse the repository at this point in the history
  • Loading branch information
matti-lamppu committed Jan 7, 2025
1 parent 8af7329 commit cca993d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
from __future__ import annotations

from pathlib import Path
from typing import Any

from django.conf import settings
from django.core.management.base import BaseCommand

from tilavarauspalvelu.utils.reservation_units.export_data import ReservationUnitExporter
from tilavarauspalvelu.services.csv_export import ReservationUnitExporter


class Command(BaseCommand):
help = "Exports reservation unit data from the database"

def handle(self, *args: Any, **options: Any) -> None:
ReservationUnitExporter.export_reservation_unit_data()
string_io = ReservationUnitExporter().write()
string_io.seek(0)
Path(settings.BASE_DIR).write_bytes(string_io.getvalue().encode("utf-8"))

0 comments on commit cca993d

Please sign in to comment.