Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Public contract registry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Public contract registry
Commits
cdf5880f
Verified
Commit
cdf5880f
authored
1 year ago
by
Alexa Valentová
Browse files
Options
Downloads
Patches
Plain Diff
fix crashing on validation errors
parent
f93836cb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#17373
passed
1 year ago
Stage: build
Stage: test_deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contracts/admin.py
+12
-2
12 additions, 2 deletions
contracts/admin.py
with
12 additions
and
2 deletions
contracts/admin.py
+
12
−
2
View file @
cdf5880f
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment