Skip to content
Snippets Groups Projects
Commit 633e7f0b authored by Alexander Pace's avatar Alexander Pace
Browse files

Update view_utils.py:

It looks like the previous check that determined if the file_version was None is broken in python3:
https://stackoverflow.com/questions/8961005/comparing-none-with-built-in-types-using-arithmetic-operators
So the comparison of log.file_version=None >=0 would error out. I added the conditional to the top of the block and combined a couple of lines.
parent 775cd822
No related branches found
No related tags found
No related merge requests found
Pipeline #94439 passed
...@@ -375,10 +375,8 @@ def eventLogToDict(log, request=None): ...@@ -375,10 +375,8 @@ def eventLogToDict(log, request=None):
taglist_uri = api_reverse("events:eventlogtag-list", taglist_uri = api_reverse("events:eventlogtag-list",
args=[log.event.graceid, log.N], args=[log.event.graceid, log.N],
request=request) request=request)
if log.filename: if log.filename and log.file_version is not None:
actual_filename = log.filename actual_filename = log.filename + ',%d' % log.file_version
if log.file_version >= 0:
actual_filename += ',%d' % log.file_version
# NOTE: the reverse function will return a urlquoted # NOTE: the reverse function will return a urlquoted
# result, so we don't need urlquote here. Effectively # result, so we don't need urlquote here. Effectively
# escaping twice results in wrong urls. # escaping twice results in wrong urls.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment