Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change filename of apartment unconfirmed and confirmed prices reports #503

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV POETRY_INSTALLER_PARALLEL=false

# Install build dependencies
RUN apt-get install -y --no-install-recommends \
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
libpq-dev \
build-essential
Expand Down
9 changes: 6 additions & 3 deletions backend/hitas/views/apartment.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ def download_latest_unconfirmed_prices(self, request, **kwargs) -> Union[HttpRes

calculation_month = monthify(input_data.validated_data["calculation_date"])

apartment = self.get_object()
apartment: Apartment = self.get_object()
apartment_data = ApartmentDetailSerializer(apartment).data
_validate_apartment_unconfirmed_prices(apartment_data, calculation_month)

Expand All @@ -947,7 +947,7 @@ def download_latest_unconfirmed_prices(self, request, **kwargs) -> Union[HttpRes
if body_parts is None:
raise ModelConflict("Missing body template", error_code="missing")

filename = f"Hinta-arvio {apartment.address}.pdf"
filename = f"Arvio {apartment.housing_company.display_name} {apartment.stair} {apartment.apartment_number}.pdf"
context = {
"apartment": apartment_data,
"additional_info": request.data.get("additional_info", ""),
Expand Down Expand Up @@ -994,7 +994,10 @@ def download_latest_confirmed_prices(self, request, **kwargs) -> HttpResponse:
if body_parts is None:
raise ModelConflict("Missing body template", error_code="missing")

filename = f"Enimmäishintalaskelma {mpc.apartment.address}.pdf"
filename = (
f"Laskelma {mpc.apartment.housing_company.display_name}"
f"{mpc.apartment.stair} {mpc.apartment.apartment_number}.pdf"
)
context = {
"maximum_price_calculation": mpc,
"user": request.user,
Expand Down
Loading