Skip to content

Commit

Permalink
Merge pull request #3337 from GSA-TTS/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm authored Feb 1, 2024
2 parents 0cf5af5 + 8c5624c commit bb62cdc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 8 additions & 0 deletions backend/config/error_handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.shortcuts import render


def handler500(request, template_name="500.html"):
"""
Custom handler for 500s. Ensures the 500 template loads with proper context (environment, login info, OMB values).
"""
return render(request, template_name, {})
2 changes: 2 additions & 0 deletions backend/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
renderer_classes=[JSONOpenAPIRenderer],
)

handler500 = "config.error_handlers.handler500"

urlpatterns = [
path("api/schema.json", schema_view),
path(
Expand Down
11 changes: 6 additions & 5 deletions backend/dissemination/summary_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,12 @@ def gather_report_data_pre_certification(i2d_data):
for obj in dissemination_data[model_name]:
row = []
for field_name in field_names:
value = getattr(obj, field_name)
# Wipe tzinfo
if isinstance(value, datetime):
value = value.replace(tzinfo=None)
row.append(value)
if not field_name.startswith("_"):
value = getattr(obj, field_name)
# Wipe tzinfo
if isinstance(value, datetime):
value = value.replace(tzinfo=None)
row.append(value)
data[model_name]["entries"].append(row)

return data
Expand Down

0 comments on commit bb62cdc

Please sign in to comment.