Skip to content

Commit

Permalink
feat: add block updating to inactive group
Browse files Browse the repository at this point in the history
  • Loading branch information
RezenkovD committed Feb 9, 2024
1 parent 2e8698f commit b2c2244
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/services/expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ def validate_expense_update(
detail="You are not a user of the group specified to update expenses!",
)
if db_user_group.status == GroupStatusEnum.INACTIVE:
if group_id != expense.group_id:
raise HTTPException(
status_code=status.HTTP_405_METHOD_NOT_ALLOWED,
detail="The user is not active in group specified to update expenses!",
)
raise HTTPException(
status_code=status.HTTP_405_METHOD_NOT_ALLOWED,
detail="The user is not active in group specified to update expenses!",
)
try:
db.query(CategoryGroup).filter_by(
category_id=expense.category_id,
Expand Down

0 comments on commit b2c2244

Please sign in to comment.