Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
Merge 16c268b into 1f9d197
Browse files Browse the repository at this point in the history
  • Loading branch information
viklund committed Sep 28, 2018
2 parents 1f9d197 + 16c268b commit 1e2e1e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lega/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ def data_received(self, data):
except Exception as e:
LOG.error("Error notifying upload: %s", e)

def send_message(self, username, filename):
def send_message(self, username, path):
"""Publish message to message broker that a file was added to inbox."""
inbox = self.inbox_location % username
filepath, filename = (filename, filename[len(inbox):])

if self.isolation:
filepath, filename = (os.path.join(inbox, filename.lstrip('/')), filename)
filepath, filename = (os.path.join(inbox, path.lstrip('/')), path)
else:
filepath, filename = (path, path[len(inbox):])

LOG.debug("Filepath %s", filepath)
msg = {'user': username,
Expand Down

0 comments on commit 1e2e1e0

Please sign in to comment.