Skip to content

Commit

Permalink
feat: hide Import EU Taric files (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
nboyse authored Sep 14, 2023
1 parent 8fe5dcc commit 5c94241
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion common/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,13 @@ class HMRCCDSManagerActions(TextChoices):

class CommonUserActions(TextChoices):
SEARCH = "SEARCH", "Search the tariff"
IMPORT = "IMPORT", "Import EU Taric files"
# Change this to be dependent on permissions later


class ImportUserActions(TextChoices):
IMPORT = "IMPORT", "Import EU Taric files"


class HomeForm(forms.Form):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop("user")
Expand All @@ -272,6 +275,11 @@ def __init__(self, *args, **kwargs):

choices += CommonUserActions.choices

if self.user.has_perm("common.add_trackedmodel") or self.user.has_perm(
"common.change_trackedmodel"
):
choices += ImportUserActions.choices

self.fields["workbasket_action"] = forms.ChoiceField(
label="",
choices=choices,
Expand Down

0 comments on commit 5c94241

Please sign in to comment.