Skip to content

Commit

Permalink
🔧refactor: aws backend activity logs
Browse files Browse the repository at this point in the history
  • Loading branch information
D10S0VSkY-OSS committed Dec 28, 2023
1 parent ac4dacd commit 722272f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sld-api-backend/src/aws/api/container/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ async def create_new_aws_profile(
if db_aws_account:
raise HTTPException(status_code=409, detail="Account already exists")
try:
result = await crud_aws.create_aws_profile(db=db, aws=aws)
crud_activity.create_activity_log(
db=db,
username=current_user.username,
squad=current_user.squad,
action=f"Create AWS account {aws.squad} {aws.environment}",
)
return await crud_aws.create_aws_profile(db=db, aws=aws)
return result
except Exception as err:
raise HTTPException(status_code=400, detail=str(err))
3 changes: 2 additions & 1 deletion sld-api-backend/src/aws/api/container/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ async def update_aws_account(
db_aws_account = await crud_aws.get_all_aws_profile(db=db, filters=filters)
if not db_aws_account:
raise HTTPException(status_code=404, detail="Account not found")
result = await crud_aws.update_aws_profile(db=db, aws_account_id=aws_account_id, updated_aws=aws)
crud_activity.create_activity_log(
db=db,
username=current_user.username,
squad=current_user.squad,
action=f"Update AWS account {aws.squad} {aws.environment}",
)
return await crud_aws.update_aws_profile(db=db, aws_account_id=aws_account_id, updated_aws=aws)
return result
except Exception as err:
raise err

0 comments on commit 722272f

Please sign in to comment.