aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/submit/lib.py
Commit message (Collapse)AuthorAgeFilesLines
* Comment changes for federationJessica Tallon2015-10-201-0/+3
| | | | | | | | | | | | | | This adds a new Comment link table that is used to link between some object and then the comment object, which can be more or less any object in Mediagoblin. The MediaComment has been renamed to TextComment as that more aptly describes what it is. There is migrations for these changes. There is also the conslidation of the Report tables into a single Report table, the same with the Notification objects. This is because both of them split out MediaEntry and Comment versions into their own polymorphic versions from a base, this is no longer a meaningful distinction as comments can be anything.
* Add public_id fixes throughout the codeJessica Tallon2015-10-071-4/+8
| | | | | | | | This adds several things, mainly code which checks for the public id and if it doesn't exist generating it where it can. This is to because we need to keep the public_id to be able to effectively soft delete models. This also adds a public_id field to the Activity along with a migration.
* Collection changes and migration for federationJessica Tallon2015-10-071-3/+3
| | | | | | | - Adds a "type" column to the Collection object and allows the CollectionItem model to contain any object. - Changes "items" to "num_items" as per TODO - Renames "uploader", "creator" and "user" to a common "actor" in most places
* Fix bug 647Boris Bobrov2015-03-021-1/+1
| | | | | Reading a file into memory resulted in depletion of memory. Now files are read and written lazily, by chunks.
* Fix #1054 - Add missing attributes to Activity.serializeJessica Tallon2014-12-081-2/+2
|
* Fix #1024 - Correctly set generator on ActivitiesJessica Tallon2014-12-021-2/+7
|
* Fix #1017 - Exception caused by activity being set on incorrect foreign keyJessica Tallon2014-10-291-8/+8
| | | | | | | | | | The .activity ForeignKey on several models such as MediaEntry expects a ActivityIntmediatory ID not an Activity ID however in submit code the activity attribute was being set the Activity, simply removing this assignment should fix the issue as everything is set correctly at this point. I have also moved the creation of the activity above the processing of media to avoid race conditions.
* Only create a slug after a media upload via the API when there is a titleJessica Tallon2014-10-221-3/+0
|
* Merge branch '905-activities'Jessica Tallon2014-10-071-0/+10
|\ | | | | | | | | | | Add Activity and Generator models which allow for activities to be created. This now works with the feed API.
| * Fix all the unit tests and clean up codeJessica Tallon2014-10-061-4/+6
| |
| * Create activity model and add activity creationJessica Tallon2014-08-221-0/+8
| | | | | | | | | | | | | | | | This creates the Activity and Genrator models from the Activity Streams spec and. I then created a migration which retro-actively create activities for media uploaded and comments created. Through out the code I've added so automatically activties are created when a user peforms an action (uploading media, commenting, etc.).
* | Merge branch 'master' into merge-python3-portChristopher Allan Webber2014-09-161-1/+34
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Has some issues, will iteratively fix! Conflicts: mediagoblin/gmg_commands/__init__.py mediagoblin/gmg_commands/deletemedia.py mediagoblin/gmg_commands/users.py mediagoblin/oauth/views.py mediagoblin/plugins/api/views.py mediagoblin/tests/test_api.py mediagoblin/tests/test_edit.py mediagoblin/tests/test_oauth1.py mediagoblin/tests/test_util.py mediagoblin/tools/mail.py mediagoblin/webfinger/views.py setup.py
| * Tidy up federation code and add tests to cover more of the APIsJessica Tallon2014-08-181-6/+6
| |
| * Fix #927 - Clean up federation code after Elrond's reviewJessica Tallon2014-07-301-0/+31
| | | | | | | | | | | | | | | | - Add json_error and use inplace of json_response where appropriate. - Add garbage_collection to config spec file. - Fix bugs in both garbage collection task and test - Handle /api/whoami when no user logged in and a test for such a case. - Validate ID is correct and user has comment privilege to comment.
| * Fixed a small error relating to the default value of media_metadatatilly-Q2014-05-141-1/+1
| |
| * Made it possible to submit media with the metadata providedtilly-Q2014-04-211-1/+3
| |
* | Fix another tests.Berker Peksag2014-08-071-1/+1
| | | | | | | | (forgot to commit earlier)
* | Use six.text_type instead of unicode().Berker Peksag2014-06-021-3/+5
|/ | | | I will be switch to use ``from __future__ import unicode_literals`` later.
* Making the API make use of the new submit tooling.Christopher Allan Webber2013-11-141-2/+12
| | | | This commit sponsored by Zakkai Kauffman-Rogoff. Thanks! :)
* Breaking out get_upload_file_limits into its own utility.Christopher Allan Webber2013-11-141-2/+18
| | | | This commit sponsored by Mikael Nordfeldth. Thank you!
* A couple more adjustments for unicode'ification of some arguments.Christopher Allan Webber2013-11-141-2/+2
| | | | This commit sponsored by Bruno Girin. Thank you!
* Generic'ifying the submit code to not rely on the werkzeug FileStorage ↵Christopher Allan Webber2013-11-131-2/+2
| | | | | | | | datastructure Important, because that only makes sense for wsgi! :) This commit sponsored by Geoff Lehr. Thank you!
* Docstring for submit_media()Christopher Allan Webber2013-11-131-0/+18
| | | | This commit sponsored by Benjamin Prager. Thank you!
* Refactoring submission utility to make it more generic! Reusable!Christopher Allan Webber2013-11-131-28/+55
| | | | | This commit sponsored by Joar Wandborg. Joar, thanks for the many things you've done for MediaGoblin!
* Starting to split out a submit_media utilityChristopher Allan Webber2013-11-121-0/+82
|
* Merge remote-tracking branch 'refs/remotes/rodney757/reprocessing'Christopher Allan Webber2013-08-211-3/+7
|\ | | | | | | | | | | Conflicts: mediagoblin/processing/task.py mediagoblin/submit/lib.py
| * Fixing normal submission of media (well for images anyway)Christopher Allan Webber2013-08-161-1/+1
| |
| * Updating to the point where we can allllmost run with the new reprocessing codeChristopher Allan Webber2013-08-161-3/+5
| | | | | | | | This commit sponsored by Odin Hørthe Omdal. Thank you!
| * added image reprocessingRodney Ewing2013-08-161-3/+5
| |
* | -update to latest masterRodney Ewing2013-08-191-2/+2
|/ | | | | | - have mg generate task_id remove
* Refactor submit util new_upload_entryElrond2013-05-211-0/+11
| | | | | | This tool creates an initial media entry for a given user. No magic. It just prefills the license with the user's default license and adds the user as uploader.
* mediagoblin/submit/lib.py: fix typoAlon Levy2013-04-231-1/+1
| | | | Signed-off-by: Alon Levy <alon@pobox.com>
* Refactor file field checking.Elrond2013-03-291-0/+11
| | | | | When uploading, the file field needs some checks, it seems. So refactor them into check_file_field and use around.
* Don't pass request into run_process_mediaSebastian Spaeth2013-01-151-4/+8
| | | | | | | | | 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>
* Make PuSHing the Pubhubsubbub server an async task (#436, #585)Sebastian Spaeth2013-01-151-35/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notifying the PuSH servers had 3 problems.  1) it was done immediately after sending of the processing task to celery. So if celery was run in a separate process we would notify the PuSH servers before the new media was processed/ visible. (#436) 2) Notification code was called in submit/views.py, so submitting via the API never resulted in notifications. (#585) 3) If Notifying the PuSH server failed, we would never retry. The solution was to make the PuSH notification an asynchronous subtask. This way: 1) it will only be called once async processing has finished, 2) it is in the main processing code path, so even API calls will result in notifications, and 3) We retry 3 times in case of failure before giving up. If the server is in a separate process, we will wait 3x 2 minutes before retrying the notification. The only downside is that the celery server needs to have access to the internet to ping the PuSH server. If that is a problem, we need to make the task belong to a special group of celery servers that has access to the internet. As a side effect, I believe I removed the limitation that prevented us from upgrading celery. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* prepare_queue_task: Take app not request.Elrond2012-12-261-3/+6
| | | | | | | | | First rename prepare_entry to prepare_queue_task, because this is really more like what this thing does. Thanks to Velmont for noting that we do not need a request in here, but an "app" is good enough. Which means, that this stuff can be called from tool scripts too.
* Processing: Factor out prepare_entry.Elrond2012-12-261-0/+28
| | | | | prepare_entry handles the task_id setup and generating a queue filename and file. it returns the queue file.
* Factor out the actual calling of the processing.Elrond2012-12-261-0/+24
| | | | | | Calling the processing task and handling the exceptions is easy, but has a bunch of caveats, so factor it out into an easy callable function.
* upload refactor: push url handlingElrond2012-12-261-0/+50
Start to refactor our upload handling in main submit and the api. Start factoring out the handling of PuSH url handling.