Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
verktoy
kindnavsync
Commits
6d8f140e
Commit
6d8f140e
authored
Apr 05, 2019
by
Morten Brekkevold
Browse files
Ignore Kind devices with missing required data.
parent
8013664d
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/kindnavsync
View file @
6d8f140e
...
...
@@ -162,7 +162,9 @@ def get_kind_data():
def
find_kind_duplicates
(
kind_data
):
dupes
=
find_duplicates
([
utstyr
[
'navn'
]
for
utstyr
in
kind_data
])
dupes
=
find_duplicates
([
utstyr
[
'navn'
]
for
utstyr
in
kind_data
if
utstyr
[
'navn'
]
])
if
dupes
:
LOG
.
warning
(
"Duplikate utstyrsnavn fra Kind: %s"
,
dupes
)
return
dupes
...
...
@@ -216,7 +218,12 @@ def should_silently_ignore(kind_json_record):
Silently ignore Kind records that appear to be automatically generated
or otherwise in error
"""
result
=
'fru.pl'
in
kind_json_record
.
get
(
'opprettet_av'
,
''
)
has_no_name
=
not
kind_json_record
.
get
(
'navn'
)
is_generated
=
(
kind_json_record
.
get
(
'opprettet_av'
,
''
)
and
'fru.pl'
in
kind_json_record
.
get
(
'opprettet_av'
,
''
)
)
result
=
has_no_name
or
is_generated
if
result
:
LOG
.
debug
(
"Ignorerer stille %s (%s)"
,
kind_json_record
.
get
(
'navn'
),
kind_json_record
.
get
(
'id'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment