You've already forked Travel-Agent
feat: Added edit profile func
This commit is contained in:
+14
-6
@@ -23,9 +23,13 @@ def validate_country(country: str):
|
||||
if not geocode:
|
||||
return False, None
|
||||
|
||||
is_loc_country = geocode.raw.get(
|
||||
"type", None,
|
||||
) == "administrative"
|
||||
is_loc_country = (
|
||||
geocode.raw.get(
|
||||
"type",
|
||||
None,
|
||||
)
|
||||
== "administrative"
|
||||
)
|
||||
|
||||
if is_loc_country:
|
||||
normalized_country = geocode.raw.get("name", "Invalid country")
|
||||
@@ -55,9 +59,13 @@ def validate_city(city: str, country: str):
|
||||
if not geocode:
|
||||
return False, None
|
||||
|
||||
check_in_valid = geocode.raw.get(
|
||||
"type", None,
|
||||
) in valid_list
|
||||
check_in_valid = (
|
||||
geocode.raw.get(
|
||||
"type",
|
||||
None,
|
||||
)
|
||||
in valid_list
|
||||
)
|
||||
|
||||
if geocode and check_in_valid:
|
||||
normalized_country = geocode.raw.get("name", "Invalid city")
|
||||
|
||||
+3
-1
@@ -12,4 +12,6 @@ class RegistrationForm(StatesGroup):
|
||||
|
||||
|
||||
class UserAltering(StatesGroup):
|
||||
new_value = State()
|
||||
message_id = State()
|
||||
column = State()
|
||||
value = State()
|
||||
|
||||
Reference in New Issue
Block a user