Run black to format code
This commit is contained in:
parent
3ad11b070a
commit
eb65f720bf
|
@ -282,12 +282,9 @@ def get_location_for_date(
|
||||||
if locations:
|
if locations:
|
||||||
final_city, final_country = locations[-1]
|
final_city, final_country = locations[-1]
|
||||||
days_since_trip = (target_date - trip.end).days
|
days_since_trip = (target_date - trip.end).days
|
||||||
|
|
||||||
# If trip ended in UK, you should be home now
|
# If trip ended in UK, you should be home now
|
||||||
if (
|
if hasattr(final_country, "alpha_2") and final_country.alpha_2 == "GB":
|
||||||
hasattr(final_country, "alpha_2")
|
|
||||||
and final_country.alpha_2 == "GB"
|
|
||||||
):
|
|
||||||
return ("Bristol", get_country("gb"))
|
return ("Bristol", get_country("gb"))
|
||||||
|
|
||||||
# For short trips to nearby countries or international trips
|
# For short trips to nearby countries or international trips
|
||||||
|
@ -297,11 +294,26 @@ def get_location_for_date(
|
||||||
and hasattr(final_country, "alpha_2")
|
and hasattr(final_country, "alpha_2")
|
||||||
and (
|
and (
|
||||||
# European countries (close by rail/ferry)
|
# European countries (close by rail/ferry)
|
||||||
final_country.alpha_2 in {"BE", "NL", "FR", "DE", "CH", "AT", "IT", "ES"}
|
final_country.alpha_2
|
||||||
|
in {"BE", "NL", "FR", "DE", "CH", "AT", "IT", "ES"}
|
||||||
# Nearby Balkan countries
|
# Nearby Balkan countries
|
||||||
or final_country.alpha_2 in {"GR", "AL", "XK", "HR", "SI", "MK", "BA", "ME", "RS", "BG", "RO"}
|
or final_country.alpha_2
|
||||||
|
in {
|
||||||
|
"GR",
|
||||||
|
"AL",
|
||||||
|
"XK",
|
||||||
|
"HR",
|
||||||
|
"SI",
|
||||||
|
"MK",
|
||||||
|
"BA",
|
||||||
|
"ME",
|
||||||
|
"RS",
|
||||||
|
"BG",
|
||||||
|
"RO",
|
||||||
|
}
|
||||||
# International trips (assume return home after trip ends)
|
# International trips (assume return home after trip ends)
|
||||||
or final_country.alpha_2 in {"US", "CA", "IN", "JP", "CN", "AU", "NZ", "BR", "AR", "ZA"}
|
or final_country.alpha_2
|
||||||
|
in {"US", "CA", "IN", "JP", "CN", "AU", "NZ", "BR", "AR", "ZA"}
|
||||||
)
|
)
|
||||||
):
|
):
|
||||||
return ("Bristol", get_country("gb"))
|
return ("Bristol", get_country("gb"))
|
||||||
|
|
Loading…
Reference in a new issue