Skip to content

Commit

Permalink
Pass when user is a manager and does not have a budget created (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnishReddyRavula committed Mar 22, 2024
1 parent f3ad018 commit 28b3c2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ jobs:
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@main
uses: sigstore/cosign-installer@v3.3.0
with:
cosign-release: 'v2.0.2' # optional
cosign-release: 'v2.2.2' # optional
- name: Check install!
run: cosign version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c
Expand Down
8 changes: 6 additions & 2 deletions projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,12 @@ def view_project(request, project_id):
if role_name == 'manager':
# delete user budgets for the user if they are manager
user = User.objects.get(username=role_username)
user_budget = ChargeBudget.objects.get(user=user, project=portal_project)
if user_budget:
try:
user_budget = ChargeBudget.objects.get(user=user, project=portal_project)
except ChargeBudget.DoesNotExist:
# the user does not have a budget created, no-op
pass
else:
user_budget.delete()
except Exception:
logger.exception("Failed to change user role")
Expand Down

0 comments on commit 28b3c2b

Please sign in to comment.