Skip to content

Commit 3c646e7

Browse files
authored
Merge pull request #144 from igorbenav/fixes
Fixes
2 parents 90eff9c + da11ad4 commit 3c646e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/api/v1/rate_limits.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ async def patch_rate_limit(
9292
raise NotFoundException("Rate Limit not found")
9393

9494
db_rate_limit_path = await crud_rate_limits.exists(db=db, tier_id=db_tier["id"], path=values.path)
95-
if db_rate_limit_path is not None:
95+
if db_rate_limit_path:
9696
raise DuplicateValueException("There is already a rate limit for this path")
9797

9898
await crud_rate_limits.exists(db=db)
99-
if db_rate_limit_path is not None:
99+
if db_rate_limit_path:
100100
raise DuplicateValueException("There is already a rate limit with this name")
101101

102102
await crud_rate_limits.update(db=db, object=values, id=db_rate_limit["id"])
@@ -113,7 +113,7 @@ async def erase_rate_limit(
113113

114114
db_rate_limit = await crud_rate_limits.get(db=db, schema_to_select=RateLimitRead, tier_id=db_tier["id"], id=id)
115115
if db_rate_limit is None:
116-
raise RateLimitException("Rate Limit not found")
116+
raise NotFoundException("Rate Limit not found")
117117

118118
await crud_rate_limits.delete(db=db, id=db_rate_limit["id"])
119119
return {"message": "Rate Limit deleted"}

0 commit comments

Comments
 (0)