diff --git a/back/backend/policy.py b/back/backend/policy.py index 1131e30..d40f56e 100644 --- a/back/backend/policy.py +++ b/back/backend/policy.py @@ -12,7 +12,8 @@ class Policy(): class Section(): - def __init__(self, title="Section", html_description="", required=False, auto_submit=False, fields={}): + def __init__(self, title="Section", html_description="", required=False, + auto_submit=False, fields={}): self.title = title self.html_description = html_description self.required = required @@ -75,7 +76,8 @@ pol.add_section(flight_section) #### Section 2 lodging_section = Section( title="Hotel Info", - html_description="

Enter hotel info here.\nPer diem rates can be found at

", + html_description="

Enter hotel info here.\nPer diem rates can be found at " + "

", fields={ "check-in_date": {"label": "Check-in date", "type": "date"}, "check-out_date": {"label": "Check-out date", "type": "date"}, diff --git a/back/backend/views.py b/back/backend/views.py index 1c368c2..b04e358 100644 --- a/back/backend/views.py +++ b/back/backend/views.py @@ -2,7 +2,7 @@ from rest_framework.decorators import api_view from django.http import JsonResponse from .models import * from .policy import pol -import json + # function that prints all the reports def get_reports(report_pk): @@ -97,9 +97,10 @@ def report(request): @api_view(['GET']) def reports(request): report_set = {"reports": []} - queryset = Report.objects.all().order_by('date_created') + queryset = Report.objects.all().filter(user_id=request.user.id).order_by('date_created') for i in queryset: data = { + "user_id": request.user.id, "report_pk": i.id, "title": i.title, "date_created": i.date_created, diff --git a/back/db.sqlite3 b/back/db.sqlite3 index 77fd67f..fe3ce3e 100644 Binary files a/back/db.sqlite3 and b/back/db.sqlite3 differ