From 4435b3fb2c419c1debea7f1381cc54a7ab0f7bb0 Mon Sep 17 00:00:00 2001 From: silvatek <85451322+silvatek@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:44:31 +0100 Subject: [PATCH] Fixing get_moons (?) (#792) --- backend/moons/router.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/moons/router.py b/backend/moons/router.py index 0bf4dfc3..2e7a84d4 100644 --- a/backend/moons/router.py +++ b/backend/moons/router.py @@ -1,4 +1,4 @@ -from typing import List +from typing import List, Optional from ninja import Router from pydantic import BaseModel @@ -30,7 +30,7 @@ class MoonViewResponse(BaseModel): system: str planet: str moon: int - detail: MoonDetailResponse + detail: Optional[MoonDetailResponse] class MoonResponse(BaseModel): @@ -153,12 +153,12 @@ def get_moons(request, system: str = None): system=moon.system, planet=moon.planet, moon=moon.moon, - reported_by=reported_by_user, + reported_by="-", ) if view_distribution: detail = MoonDetailResponse( - reported_by=moon.reported_by, + reported_by=reported_by_user, monthly_revenue=moon.monthly_revenue, ) moon_response.detail = detail