diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2013-01-15 15:03:00 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2013-01-15 15:03:00 +0100 |
commit | c7b3d070b65a84e3bfa9d8e3e6f52aac6552910f (patch) | |
tree | 0895ba63b15612c0da97e5eebe3fa83d73174219 /mediagoblin/submit/lib.py | |
parent | 2cfffd5ed8c054bb60c27ede4e69667f97d12b09 (diff) | |
download | mediagoblin-c7b3d070b65a84e3bfa9d8e3e6f52aac6552910f.tar.lz mediagoblin-c7b3d070b65a84e3bfa9d8e3e6f52aac6552910f.tar.xz mediagoblin-c7b3d070b65a84e3bfa9d8e3e6f52aac6552910f.zip |
Don't pass request into run_process_media
People(tm) want to start run_process_media from the CLI and might not
have a request object handy. So pass in the feed_url into
run_process_media rather than the request object and allow the feed url
to be empty (resulting in no PuSH notification at all then).
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/submit/lib.py')
-rw-r--r-- | mediagoblin/submit/lib.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mediagoblin/submit/lib.py b/mediagoblin/submit/lib.py index ba07c6fa..679fc543 100644 --- a/mediagoblin/submit/lib.py +++ b/mediagoblin/submit/lib.py @@ -54,10 +54,14 @@ def prepare_queue_task(app, entry, filename): return queue_file -def run_process_media(entry, request): - feed_url = request.urlgen( - 'mediagoblin.user_pages.atom_feed', - qualified=True, user=request.user.username) +def run_process_media(entry, feed_url=None): + """Process the media asynchronously + + :param entry: MediaEntry() instance to be processed. + :param feed_url: A string indicating the feed_url that the PuSH servers + should be notified of. This will be sth like: `request.urlgen( + 'mediagoblin.user_pages.atom_feed',qualified=True, + user=request.user.username)`""" try: process_media.apply_async( [entry.id, feed_url], {}, |