Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
osp
tools.ethertoff
Commits
d17b0332
Commit
d17b0332
authored
Jun 14, 2019
by
alexandre
Browse files
Fixed migration error cause of top-level db query
parent
d60faf58
Changes
1
Hide whitespace changes
Inline
Side-by-side
ethertoff/management/commands/index.py
View file @
d17b0332
...
...
@@ -98,11 +98,6 @@ short_names = {
"http://purl.org/dc/terms/Location"
:
"place"
,
}
HOST
=
None
if
Site
.
objects
.
count
()
>
0
:
site
=
Site
.
objects
.
all
()[
0
]
HOST
=
site
.
domain
def
query_results_to_template_articles
(
query_results
):
"""
Transform the RDFLIB SPARQL query result into the row that we want to use for the template
...
...
@@ -157,9 +152,15 @@ def query_results_to_template_articles(query_results):
return
sorted
(
template_articles
,
key
=
lambda
a
:
a
[
'date'
]
if
'date'
in
a
else
0
,
reverse
=
True
)
def
snif
():
global
HOST
HOST
=
None
if
Site
.
objects
.
count
()
>
0
:
site
=
Site
.
objects
.
all
()[
0
]
HOST
=
site
.
domain
if
not
HOST
:
return
"No site domain settings found"
host
=
u
"http://%s"
%
HOST
start
=
clock
()
...
...
Write
Preview
Supports
Markdown
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