Fix adding asset restrictions
This commit is contained in:
@@ -86,6 +86,10 @@ class AssetRestrictionCreate(
|
||||
submit_url_name = "assetrestriction_create"
|
||||
submit_url_args = ["type", "group"]
|
||||
|
||||
def form_invalid(self, form):
|
||||
"""If the form is invalid, render the invalid form."""
|
||||
return self.get(self.request, **self.kwargs, form=form)
|
||||
|
||||
def pre_save_mutate(self, user, obj):
|
||||
try:
|
||||
assetgroup = AssetGroup.objects.get(pk=self.kwargs["group"], user=user)
|
||||
|
||||
Reference in New Issue
Block a user