Saves unlim by -1 added

This commit is contained in:
Profitroll 2023-01-19 14:13:14 +01:00
parent 02552dce5a
commit 5f8dff42c3
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ async def devices_post(name: str, os: str, apikey: APIKey = Depends(get_api_key)
user = user_by_key(apikey)
if col_devices.count_documents({"user": user}) >= configGet("devices", "limits"):
if (configGet("devices", "limits") != -1) and (col_devices.count_documents({"user": user}) >= configGet("devices", "limits")):
return UJSONResponse(
{
"detail": f'Too many devices. This instance allows to register only {configGet("devices", "limits")} devices per user',

View File

@ -137,7 +137,7 @@ async def saves_post(device: str, files: List[UploadFile], apikey: APIKey = Depe
error_return = HTTPException(HTTP_406_NOT_ACCEPTABLE, detail="You must provide two files: save file and SaveGameInfo for that save")
if col_saves.count_documents({"user": user}) >= configGet("saves", "limits"):
if (configGet("saves", "limits") != -1) and (col_saves.count_documents({"user": user}) >= configGet("saves", "limits")):
return UJSONResponse(
{
"detail": f'Too many save files. This instance allows to store only {configGet("saves", "limits")} saves per user',