Skip to content
Snippets Groups Projects
Commit b1c8131f authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

fix approval permission

parent ff1c9314
No related branches found
No related tags found
No related merge requests found
Pipeline #13565 passed
...@@ -65,7 +65,7 @@ class ContractAdminForm(forms.ModelForm): ...@@ -65,7 +65,7 @@ class ContractAdminForm(forms.ModelForm):
allowed_choices.append((choice_key, choice_label)) allowed_choices.append((choice_key, choice_label))
if self.instance.status == Contract.StatusTypes.APPROVED: if self.instance.status == Contract.StatusTypes.APPROVED:
if self.current_user.has_perm("contract.approve"): if self.current_user.has_perm("contracts.approve"):
if choice_key == Contract.StatusTypes.WORK_IN_PROGRESS: if choice_key == Contract.StatusTypes.WORK_IN_PROGRESS:
allowed_choices.append( allowed_choices.append(
( (
...@@ -76,7 +76,7 @@ class ContractAdminForm(forms.ModelForm): ...@@ -76,7 +76,7 @@ class ContractAdminForm(forms.ModelForm):
continue continue
if self.instance.status == Contract.StatusTypes.TO_BE_APPROVED: if self.instance.status == Contract.StatusTypes.TO_BE_APPROVED:
if self.current_user.has_perm("contract.approve"): if self.current_user.has_perm("contracts.approve"):
if choice_key in ( if choice_key in (
Contract.StatusTypes.APPROVED, Contract.StatusTypes.APPROVED,
Contract.StatusTypes.REJECTED, Contract.StatusTypes.REJECTED,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment