mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[+] Fixed positional argument in Firestore query
This commit is contained in:
parent
9042bae61e
commit
1123b7f60d
@ -6,6 +6,7 @@ import firebase_admin
|
||||
import jwt
|
||||
from firebase_admin import auth, credentials, firestore
|
||||
from google.api_core.exceptions import Aborted, DataLoss, NotFound, OutOfRange, PermissionDenied, ResourceExhausted
|
||||
from google.cloud.firestore_v1 import FieldFilter
|
||||
|
||||
import file_manager
|
||||
from generic_executor import mc_manager
|
||||
@ -51,7 +52,7 @@ def user_field_exists(user_id: str) -> bool:
|
||||
|
||||
def server_name_taken(user_id: str, server_name: str) -> bool:
|
||||
servers = firestore_database.collection('users').document(user_id).collection('servers')
|
||||
query = servers.where(field_path='name', op_string='==', value=server_name)
|
||||
query = servers.where(filter=FieldFilter(field_path='name', op_string='==', value=server_name))
|
||||
for _ in query.stream():
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user