Skip to content

Commit

Permalink
Resolved issue with browsing unknown streams
Browse files Browse the repository at this point in the history
  • Loading branch information
watucker committed Sep 26, 2019
1 parent 22bb45c commit 6b9b5ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uploader/models/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ def save(self, *args, **kwargs):

super(Stream, self).save(*args, **kwargs)

def __unicode__(self):
def __str__(self):
return str(self.name)
5 changes: 4 additions & 1 deletion uploader/views/browse_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ def get_context_data(self, stream, rel_dir=None, form=None, **kwargs):

context = super(BrowseStreamView, self).get_context_data(**kwargs)

if not isinstance(stream, Stream):
if isinstance(stream, str):
stream = get_stream(self.request.user, stream)

is_unknown = not isinstance(stream, Stream)

arrivals_dir = self.request.user.uploaderprofile.data_directory
browse_dir = os.path.join(arrivals_dir, stream.name)
if rel_dir:
Expand All @@ -108,6 +110,7 @@ def get_context_data(self, stream, rel_dir=None, form=None, **kwargs):
"rel_dir": rel_dir,
"stream": stream,
"parent": parent,
"is_unknown": is_unknown,
})
return context

Expand Down

0 comments on commit 6b9b5ed

Please sign in to comment.