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
989c6ad9
Verified
Commit
989c6ad9
authored
1 year ago
by
Alexa Valentová
Browse files
Options
Downloads
Patches
Plain Diff
default to true
parent
cdf5880f
No related branches found
No related tags found
No related merge requests found
Pipeline
#17478
passed
1 year ago
Stage: build
Stage: test_deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contracts/admin.py
+16
-3
16 additions, 3 deletions
contracts/admin.py
contracts/models.py
+8
-2
8 additions, 2 deletions
contracts/models.py
with
24 additions
and
5 deletions
contracts/admin.py
+
16
−
3
View file @
989c6ad9
...
...
@@ -123,7 +123,10 @@ class ContractFileAdmin(
class
ParentContractInlineMixin
:
def
get_parent_object_is_editable
(
self
,
obj
):
return
obj
.
is_editable_without_approve_permission
if
hasattr
(
obj
,
"
is_editable_without_approve_permission
"
):
return
obj
.
is_editable_without_approve_permission
return
False
def
has_add_permission
(
self
,
request
,
obj
=
None
):
if
(
...
...
@@ -165,7 +168,12 @@ class ContracteeSignatureRepresentativeInline(
elif
hasattr
(
obj
,
"
is_editable_without_approve_permission
"
):
return
obj
.
is_editable_without_approve_permission
return
False
# FIXME: We MUST return a True value here, since the admin seemingly
# creates the parent ContracteeSignature with empty data, then
# validates this inline before actually filling any fields.
# Thus, it has no `contract` attribute.
return
True
def
get_formset
(
self
,
request
,
obj
=
None
,
**
kwargs
):
formset
=
super
().
get_formset
(
request
,
obj
,
**
kwargs
)
...
...
@@ -193,7 +201,12 @@ class SigneeSignatureRepresentativeInline(
elif
hasattr
(
obj
,
"
is_editable_without_approve_permission
"
):
return
obj
.
is_editable_without_approve_permission
return
False
# FIXME: We MUST return a True value here, since the admin seemingly
# creates the parent ContracteeSignature with empty data, then
# validates this inline before actually filling any fields.
# Thus, it has no `contract` attribute.
return
True
model
=
SigneeSignatureRepresentative
extra
=
0
...
...
This diff is collapsed.
Click to expand it.
contracts/models.py
+
8
−
2
View file @
989c6ad9
...
...
@@ -993,7 +993,10 @@ class ContracteeSignature(models.Model):
)
def
__str__
(
self
)
->
str
:
return
f
"
{
str
(
self
.
contractee
)
}
-
{
self
.
date
}
"
if
hasattr
(
self
,
"
contractee
"
):
return
f
"
{
str
(
self
.
contractee
)
}
-
{
self
.
date
}
"
else
:
return
f
"
Bez smluvní strany -
{
self
.
date
}
"
class
Meta
:
app_label
=
"
contracts
"
...
...
@@ -1030,7 +1033,10 @@ class SigneeSignature(models.Model):
)
def
__str__
(
self
)
->
str
:
return
f
"
{
str
(
self
.
signee
)
}
-
{
self
.
date
}
"
if
hasattr
(
self
,
"
signee
"
):
return
f
"
{
str
(
self
.
signee
)
}
-
{
self
.
date
}
"
else
:
return
f
"
Bez smluvní strany -
{
self
.
date
}
"
class
Meta
:
app_label
=
"
contracts
"
...
...
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