Skip to content

Commit

Permalink
Fixing get_moons (?) (minmatarfleet#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvatek authored Oct 8, 2024
1 parent 105a683 commit 4435b3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/moons/router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import List, Optional

from ninja import Router
from pydantic import BaseModel
Expand Down Expand Up @@ -30,7 +30,7 @@ class MoonViewResponse(BaseModel):
system: str
planet: str
moon: int
detail: MoonDetailResponse
detail: Optional[MoonDetailResponse]


class MoonResponse(BaseModel):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4435b3f

Please sign in to comment.