Stahovani pocasi, drobne upravy
This commit is contained in:
@@ -4,7 +4,7 @@ from sqlalchemy import delete, insert, select, func, text
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from strawberry.file_uploads import Upload
|
||||
from background_jobs.elevation import add_terrain_elevation_to_flight
|
||||
from background_jobs.weather import download_weather
|
||||
from background_jobs.weather import download_weather_for_flight
|
||||
from database import models
|
||||
from database.models import flight_has_copilot
|
||||
from database.transaction import get_session
|
||||
@@ -155,12 +155,12 @@ class FlightMutationResolver(BaseMutationResolver):
|
||||
flight = await self._do_create(db, data)
|
||||
|
||||
context.background_tasks.add_task(
|
||||
download_weather,
|
||||
download_weather_for_flight,
|
||||
flight_id=flight.id, airport_id=flight.takeoff_airport_id, date_time=flight.takeoff_datetime,
|
||||
type_="takeoff"
|
||||
)
|
||||
context.background_tasks.add_task(
|
||||
download_weather,
|
||||
download_weather_for_flight,
|
||||
flight_id=flight.id, airport_id=flight.landing_airport_id, date_time=flight.landing_datetime,
|
||||
type_="landing"
|
||||
)
|
||||
@@ -193,7 +193,7 @@ class FlightMutationResolver(BaseMutationResolver):
|
||||
data['takeoff_datetime'] = input.takeoff_datetime or flight_data['takeoff_datetime']
|
||||
|
||||
context.background_tasks.add_task(
|
||||
download_weather, flight_id=id, airport_id=takeoff_airport_id, date_time=data['takeoff_datetime'],
|
||||
download_weather_for_flight, flight_id=id, airport_id=takeoff_airport_id, date_time=data['takeoff_datetime'],
|
||||
type_="takeoff"
|
||||
)
|
||||
|
||||
@@ -207,7 +207,7 @@ class FlightMutationResolver(BaseMutationResolver):
|
||||
data['landing_datetime'] = input.landing_datetime or flight_data['landing_datetime']
|
||||
|
||||
context.background_tasks.add_task(
|
||||
download_weather, flight_id=id, airport_id=landing_airport_id, date_time=data['landing_datetime'],
|
||||
download_weather_for_flight, flight_id=id, airport_id=landing_airport_id, date_time=data['landing_datetime'],
|
||||
type_="landing"
|
||||
)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ from graphql_schema.dataloaders.single_model import (
|
||||
)
|
||||
from graphql_schema.permissions import IsAuthenticated
|
||||
from graphql_schema.sqlalchemy_to_strawberry_type import strawberry_sqlalchemy_type
|
||||
from paths import get_avatar_url, get_title_image_url, get_photo_thumbnail_url, get_photo_url, FLIGHT_GPX_TRACK_PATH
|
||||
from paths import get_avatar_url, get_title_image_url, get_photo_thumbnail_url, get_photo_url, FLIGHT_GPX_TRACK_PATH, airport_icon_url
|
||||
|
||||
|
||||
@strawberry.type
|
||||
@@ -67,14 +67,9 @@ class Airport:
|
||||
reporting_points: List[ReportingPoint] = strawberry.field(
|
||||
resolver=lambda root: reporting_points_dataloader.load(root.id)
|
||||
)
|
||||
runways: List[Runway] = strawberry.field(
|
||||
resolver=lambda root: runways_dataloader.load(root.id)
|
||||
)
|
||||
frequencies: List[Frequency] = strawberry.field(
|
||||
resolver=lambda root: frequencies_dataloader.load(root.id)
|
||||
)
|
||||
|
||||
# TODO: loader na ikonu
|
||||
runways: List[Runway] = strawberry.field(resolver=lambda root: runways_dataloader.load(root.id))
|
||||
frequencies: List[Frequency] = strawberry.field(resolver=lambda root: frequencies_dataloader.load(root.id))
|
||||
icon_url: str = strawberry.field(resolver=lambda root: airport_icon_url(root.icao_code))
|
||||
|
||||
|
||||
@strawberry.type
|
||||
|
||||
Reference in New Issue
Block a user