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
6009d537
Commit
6009d537
authored
May 26, 2021
by
carlosribas
Browse files
Avoid error when there is no count
parent
d43861b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
rnacentral/apiv1/renderers.py
rnacentral/apiv1/renderers.py
+6
-1
No files found.
rnacentral/apiv1/renderers.py
View file @
6009d537
...
...
@@ -13,7 +13,12 @@ class RnaFastaRenderer(renderers.BaseRenderer):
RnaFastaSerializer can return either a single entry or a list of entries.
"""
if
'results'
in
data
:
# list of entries
text
=
'# %i total entries, next page: %s, previous page: %s
\n
'
%
(
data
[
'count'
],
data
[
'next'
],
data
[
'previous'
])
try
:
text
=
'# %i total entries, next page: %s, previous page: %s
\n
'
%
(
data
[
'count'
],
data
[
'next'
],
data
[
'previous'
]
)
except
KeyError
:
text
=
'# next page: %s, previous page: %s
\n
'
%
(
data
[
'next'
],
data
[
'previous'
])
for
entry
in
data
[
'results'
]:
text
+=
entry
[
'fasta'
]
return
text
...
...
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