mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-12 21:48:35 +03:00
method renaming
This commit is contained in:
@@ -62,7 +62,7 @@ class UserState:
|
|||||||
def in_group(self, group_id: str) -> bool:
|
def in_group(self, group_id: str) -> bool:
|
||||||
return group_id in self.user_groups_names
|
return group_id in self.user_groups_names
|
||||||
|
|
||||||
def has_quota_sheet(self) -> bool:
|
def has_quota_monthly_sheets(self) -> bool:
|
||||||
"""
|
"""
|
||||||
checks if a user has reached their sheet quota
|
checks if a user has reached their sheet quota
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def create_sheet(
|
|||||||
if not user.in_group(sheet.group_id):
|
if not user.in_group(sheet.group_id):
|
||||||
raise HTTPException(status_code=403, detail="User does not have access to this group.")
|
raise HTTPException(status_code=403, detail="User does not have access to this group.")
|
||||||
|
|
||||||
if not user.has_quota_sheet():
|
if not user.has_quota_monthly_sheets():
|
||||||
raise HTTPException(status_code=429, detail="User has reached their sheet quota.")
|
raise HTTPException(status_code=429, detail="User has reached their sheet quota.")
|
||||||
|
|
||||||
if not user.is_sheet_frequency_allowed(sheet.frequency):
|
if not user.is_sheet_frequency_allowed(sheet.frequency):
|
||||||
|
|||||||
Reference in New Issue
Block a user