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
Carlos Ribas
rnacentral-webcode
Commits
b3aafd48
Commit
b3aafd48
authored
Jul 21, 2021
by
carlosribas
Browse files
Avoid IndexError
parent
06f92713
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
rnacentral/sequence_search/views.py
rnacentral/sequence_search/views.py
+5
-2
No files found.
rnacentral/sequence_search/views.py
View file @
b3aafd48
...
...
@@ -153,8 +153,11 @@ def dashboard(request):
get_current_month
=
list
(
expert_db_results
[
index
][
key
][
-
1
])
if
list
(
expert_db_results
[
index
][
key
])
else
None
get_current_month
=
get_current_month
.
pop
()
if
get_current_month
else
None
get_last_month
=
list
(
expert_db_results
[
index
][
key
][
-
2
])
if
list
(
expert_db_results
[
index
][
key
])
else
None
get_last_month
=
get_last_month
.
pop
()
if
get_last_month
else
None
try
:
get_last_month
=
list
(
expert_db_results
[
index
][
key
][
-
2
])
if
list
(
expert_db_results
[
index
][
key
])
else
None
get_last_month
=
get_last_month
.
pop
()
if
get_last_month
else
None
except
IndexError
:
get_last_month
=
None
if
get_current_month
==
current_month
:
current_month_pie_chart
.
append
({
key
:
expert_db_results
[
index
][
key
][
-
1
][
current_month
]})
...
...
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