diff --git a/blocnote/apps/budgetSimulator/views.py b/blocnote/apps/budgetSimulator/views.py
index 62eeb252642ef4af830f0d7896bdc43eb7bc1fcf..656fa2e050a3f0b631d389dd0b5098666a3ba21f 100644
--- a/blocnote/apps/budgetSimulator/views.py
+++ b/blocnote/apps/budgetSimulator/views.py
@@ -7,7 +7,7 @@ from bpfin.back_end_call.back_end_budget import budget_simulation
from blocnote.lib.fetch_data import (
get_financing_overview, get_customer_preference, get_utility_bill, get_annual_bills, get_income_statement,
- get_growth_rate, get_liabilities, get_cash_balance, get_loan_options
+ get_growth_rate, get_liabilities, get_cash_balance, get_loan_options, get_building_data
)
class Index(View):
@@ -15,8 +15,10 @@ class Index(View):
def get(self, request, building_id):
"""HTTP GET request."""
+ building = get_building_data(building_id)
context = {
'building_id': building_id,
+ 'building': building,
}
return render(request, 'budgetSimulator/index.html', context=context)
diff --git a/blocnote/apps/landingPage/templates/landingPage/index.html b/blocnote/apps/landingPage/templates/landingPage/index.html
index 5a3fbd392143a9c6e7a7d1d0bfb0380ba59442ab..eb61727dce07e4967d2ada36f639397d4dd3f8da 100644
--- a/blocnote/apps/landingPage/templates/landingPage/index.html
+++ b/blocnote/apps/landingPage/templates/landingPage/index.html
@@ -5,6 +5,9 @@
BLOCNOTE
+
+ {{ building.street_address }}
+
diff --git a/blocnote/apps/landingPage/views.py b/blocnote/apps/landingPage/views.py
index 9ffe828732be6c16791a0cb8b7f143080c25259f..ae588f147a318ff864bfe9e5e5c9b0d102425320 100644
--- a/blocnote/apps/landingPage/views.py
+++ b/blocnote/apps/landingPage/views.py
@@ -2,12 +2,10 @@
from django.shortcuts import render
from django.views import View
-from blocnote.apps.financialInputs.models import FinancingOverview
-from blocnote.apps.financialInputs.models import BillsOverview
-from blocnote.apps.financialInputs.models import CustomerPreference
-from blocnote.apps.financialInputs.models import CashBalance
-from blocnote.apps.financialInputs.models import IncomeStatement
-from blocnote.apps.financialInputs.models import LoanOptions
+from blocnote.apps.financialInputs.models import (
+ FinancingOverview, BillsOverview, CustomerPreference, CashBalance, IncomeStatement, LoanOptions
+)
+from blocnote.lib.fetch_data import get_building_data
class Index(View):
@@ -41,6 +39,7 @@ class Index(View):
Display links to the inputs, budget simulation and preliminary and full analysis pages.
"""
+ building = get_building_data(building_id)
not_saved_list_for_prelim = self.check_inputs(building_id, self.models_for_prelim)
not_saved_list_for_budget = self.check_inputs(building_id, self.models_for_budget)
if_completed = not not_saved_list_for_prelim
@@ -48,7 +47,7 @@ class Index(View):
if_completed_for_budget = not not_saved_list_for_budget
if_started_for_budget = len(not_saved_list_for_budget) < len(self.models_for_budget)
context = {
- 'building_id': building_id,
+ 'building': building,
'if_started': if_started,
'if_completed': if_completed,
'not_saved_list_for_prelim': not_saved_list_for_prelim,