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
c7d22fbc
Commit
c7d22fbc
authored
2 years ago
by
Tomáš Valenta
Browse files
Options
Downloads
Patches
Plain Diff
normalization, files
parent
b505986e
No related branches found
No related tags found
1 merge request
!3
Release
Pipeline
#12500
failed
2 years ago
Stage: build
Stage: test_deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contracts/management/commands/import_old_contracts.py
+56
-5
56 additions, 5 deletions
contracts/management/commands/import_old_contracts.py
with
56 additions
and
5 deletions
contracts/management/commands/import_old_contracts.py
+
56
−
5
View file @
c7d22fbc
...
@@ -276,10 +276,38 @@ class Command(BaseCommand):
...
@@ -276,10 +276,38 @@ class Command(BaseCommand):
r
"
^(Předsednictvo krajského sdružení |Předsednictvo |Místní předsednictvo )
"
,
r
"
^(Předsednictvo krajského sdružení |Předsednictvo |Místní předsednictvo )
"
,
""
""
),
),
(
r
"
^Krajské předsednictvo
"
,
"
Krajské sdružení
"
),
(
(
r
"
ého kraje$
"
,
r
"
ého kraje$
"
,
"
ý kraj
"
"
ý kraj
"
)
),
(
r
"
^Olomouc$
"
,
"
Místní sdružení Olomouc
"
),
(
r
"
^Olomoucký kraj$
"
,
"
Krajské sdružení Olomoucký kraj
"
),
(
r
"
^Pardubický kraj$
"
,
"
Krajské sdružení Pardubický kraj
"
),
(
r
"
^Jihočeský kraj$
"
,
"
Krajské sdružení Jihočeský kraj
"
),
(
r
"
^Královehradecký kraj$
"
,
"
Krajské sdružení Královehradecký kraj
"
),
(
r
"
^Pardubický kraj$
"
,
"
Krajské sdružení Pardubický kraj
"
),
)
)
for
pattern
in
patterns
:
for
pattern
in
patterns
:
...
@@ -584,7 +612,7 @@ class Command(BaseCommand):
...
@@ -584,7 +612,7 @@ class Command(BaseCommand):
signing_party_value
=
signing_party_value
.
strip
()
signing_party_value
=
signing_party_value
.
strip
()
match
signing_party_key
:
match
signing_party_key
:
case
"
sídlo
"
:
case
[
"
sídlo
"
|
"
bydliště
"
]
:
if
is_contractee
:
if
is_contractee
:
continue
continue
...
@@ -648,7 +676,7 @@ class Command(BaseCommand):
...
@@ -648,7 +676,7 @@ class Command(BaseCommand):
continue
continue
instance
.
ico_number
=
signing_party_value
instance
.
ico_number
=
str
(
signing_party_value
)
case
"
zástupce
"
:
case
"
zástupce
"
:
if
not
isinstance
(
signing_party_value
,
str
|
list
):
if
not
isinstance
(
signing_party_value
,
str
|
list
):
issue_count
+=
1
issue_count
+=
1
...
@@ -787,7 +815,14 @@ class Command(BaseCommand):
...
@@ -787,7 +815,14 @@ class Command(BaseCommand):
).
first
()
).
first
()
if
existing_instance
is
not
None
:
if
existing_instance
is
not
None
:
if
existing_instance
.
ico_number
is
None
and
instance
.
ico_number
is
not
None
:
existing_instance
.
ico_number
=
instance
.
ico_number
existing_instance
.
save
()
instance
=
existing_instance
instance
=
existing_instance
elif
existing_instance
.
ico_number
==
instance
.
ico_number
or
instance
.
ico_number
is
None
:
instance
=
existing_instance
else
:
instance
.
save
()
else
:
else
:
instance
.
save
()
instance
.
save
()
...
@@ -1019,7 +1054,6 @@ class Command(BaseCommand):
...
@@ -1019,7 +1054,6 @@ class Command(BaseCommand):
f
"
Contract
{
slug
}
has an invalid filing area:
{
value
}
.
"
f
"
Contract
{
slug
}
has an invalid filing area:
{
value
}
.
"
)
)
)
)
case
"
smluvní strany
"
:
case
"
smluvní strany
"
:
if
not
isinstance
(
value
,
list
):
if
not
isinstance
(
value
,
list
):
observed_issues_count
+=
1
observed_issues_count
+=
1
...
@@ -1061,6 +1095,23 @@ class Command(BaseCommand):
...
@@ -1061,6 +1095,23 @@ class Command(BaseCommand):
contractees
.
append
(
instance
)
contractees
.
append
(
instance
)
else
:
else
:
signees
.
append
(
instance
)
signees
.
append
(
instance
)
case
"
soubory
"
:
if
not
isinstance
(
value
,
list
):
observed_issues_count
+=
1
contract
.
notes
+=
f
"
Špatně zadané soubory.
\n
"
if
self
.
verbosity
>=
2
:
self
.
stderr
.
write
(
self
.
style
.
NOTICE
(
f
"
Files for
{
slug
}
are not a list:
{
value
}
.
"
)
)
continue
for
filename
in
value
:
if
not
isinstance
(
filename
,
str
):
if
not
is_already_imported
:
if
not
is_already_imported
:
if
contract
.
name
in
(
None
,
""
)
or
(
if
contract
.
name
in
(
None
,
""
)
or
(
...
...
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