Skip to content

Commit

Permalink
[IMP] Renamed exception PermissionDenied into PermissionDeniedError
Browse files Browse the repository at this point in the history
  • Loading branch information
c8y3 committed Mar 20, 2024
1 parent 1ffb561 commit aa97648
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions source/app/blueprints/manage/manage_cases_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
from app.util import response_success
from app.business.cases import delete
from app.business.errors import BusinessProcessingError
from app.business.errors import PermissionDenied
from app.business.errors import PermissionDeniedError

manage_cases_blueprint = Blueprint('manage_case',
__name__,
Expand Down Expand Up @@ -240,7 +240,7 @@ def api_delete_case(cur_id, caseid):
return response_success('Case successfully deleted')
except BusinessProcessingError as e:
return response_error(str(e))
except PermissionDenied:
except PermissionDeniedError:
return ac_api_return_access_denied(caseid=cur_id)


Expand Down
4 changes: 2 additions & 2 deletions source/app/business/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
from app.iris_engine.utils.tracker import track_activity
from app.datamgmt.manage.manage_cases_db import delete_case
from app.business.errors import BusinessProcessingError
from app.business.errors import PermissionDenied
from app.business.errors import PermissionDeniedError


def delete(identifier, context_case_identifier):
if not ac_fast_check_current_user_has_case_access(identifier, [CaseAccessLevel.full_access]):
raise PermissionDenied()
raise PermissionDeniedError()

if identifier == 1:
track_activity(f'tried to delete case {identifier}, but case is the primary case',
Expand Down
2 changes: 1 addition & 1 deletion source/app/business/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class BusinessProcessingError(Exception):
pass


class PermissionDenied(Exception):
class PermissionDeniedError(Exception):
pass

0 comments on commit aa97648

Please sign in to comment.