Skip to content
Snippets Groups Projects
Verified Commit cdf5880f authored by Alexa Valentová's avatar Alexa Valentová
Browse files

fix crashing on validation errors

parent f93836cb
No related branches found
No related tags found
No related merge requests found
Pipeline #17373 passed
......@@ -159,9 +159,14 @@ class ContracteeSignatureRepresentativeInline(
def get_parent_object_is_editable(self, obj):
if hasattr(obj, "contract"):
return obj.contract.is_editable_without_approve_permission
else:
# Crashes if there is invalid input otherwise.
elif hasattr(obj, "is_editable_without_approve_permission"):
return obj.is_editable_without_approve_permission
return False
def get_formset(self, request, obj=None, **kwargs):
formset = super().get_formset(request, obj, **kwargs)
formset.request = request
......@@ -182,9 +187,14 @@ class SigneeSignatureRepresentativeInline(
def get_parent_object_is_editable(self, obj):
if hasattr(obj, "contract"):
return obj.contract.is_editable_without_approve_permission
else:
# Crashes if there is invalid input otherwise.
elif hasattr(obj, "is_editable_without_approve_permission"):
return obj.is_editable_without_approve_permission
return False
model = SigneeSignatureRepresentative
extra = 0
......
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