Skip to content

Commit

Permalink
Fix file_preview view
Browse files Browse the repository at this point in the history
  • Loading branch information
McCrea committed Feb 22, 2014
1 parent 88c5464 commit e1824aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@ def file_preview(request, file = None):
file_name_without_extension = file
if not ds.check_exists(GRAPH_BUCKET + '/' + file_name_without_extension + '.png', None):
file_name_without_extension = None
#TODO: Might need to be simplified or moved to a function in fileinfo
#TODO: Might need to be simplified or moved to a function in fileinfo
# TODO the folowing should be replaced by a method in the APIDatastore
lst = ds.list(DATA_BUCKET)
file_info = None
for temp_file in lst:
temp_file.filename = temp_file.filename.rpartition('/')[2]
if temp_file.filename == file:
file_info = temp_file;
return render(request, 'file_preview.html', {'current_file' : file_info, 'authed_user_nick': authed_user_nick, 'file_name_without_extension' : file_name_without_extension})

###########################################################################
## \brief Is called when the pagelet containing the app's main panel is requested.
Expand Down

0 comments on commit e1824aa

Please # to comment.