aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin
Commit message (Collapse)AuthorAgeFilesLines
* Use inspect_table; default user license==None.Elrond2013-01-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use inspect_table in the new migration. Makes code more readable, really. And make the default for the preferred license be None. This is a userspace thing, so we can even change the migration here. Changing the migration means, that people running the migration before this commit get a "" in User.license_preference, while people running the migration now get a None. Both values are okay. None has been designated as "Use the site's default". We're not actually having a site default right now. Which means no license is selected in the dropdown. While "" means "All rights reserved" being chosen by the user. Side note: Having no license being selected in the submit dropdown is as "worse" as before and does not really hurt much. MediaEntry.license==None means "All rights reserved" as does "" also do.
* user.get('moo') -> user.mooSebastian Spaeth2013-01-223-7/+7
| | | | | | | User fields are always existent, so there is no need to .get() them, just use them directly. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Merge remote-tracking branch 'refs/remotes/spaetz/521_license_preference' ↵Christopher Allan Webber2013-01-226-37/+63
|\ | | | | | | into mergetest
| * Add a license preference fieldMark Holmquist2013-01-176-37/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | This feature is absolutely necessary. Now a user can simply define their default license and quickly go through a form, as opposed to stopping to click on the select and choosing the same option over and over again. Also added DB migration for the field, so that's working now, too. Rebased by Sebastian and made the default value to be unicode. Reviewed-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Moved MediaComment form descriptions to apt. placeJoar Wandborg2013-01-222-5/+5
| |
* | Also set login_failed in case of form errorsSebastian Spaeth2013-01-211-11/+12
| | | | | | | | | | | | | | | | | | If we send a POST request to the login page which contained form errors (e.g. a too short password), the variable "login_failed" was not set to true. This condition was tested by the test suite however, so we should make sure that login_failed is set even if the form failed to validate. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Restructure ForgotPassword viewSebastian Spaeth2013-01-213-79/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Remove mongo limitations (no 'or' when querying for either username or email). 2) Lost password function revealed if an user name or email address is registered, which can be considered a data leak. Leaking user names is OK, they are public anyway, but don't reveal lookup success in case the lookup happened by email address. Simply respond: "If you have an account here, we have send you your email"? 3) username and email search was case sensitive. Made username search case insensitive (they are always stored lowercase in the db). Keep email-address search case sensitive for now. This might need further discussion 4) Remove a whole bunch of indention in the style of: if no error: ... if no error: ... if no error: actually do something in the regular case by restructuring the function. 5) Outsource the sanity checking for username and email fields into the validator function. This way, we get automatic case sanity checking and sanitizing for all required fields. 6) Require 5-char password and fix tests Originally, the Change password form required a password between 6-30 chars while the registration and login form did not require anything special. This commit introduces a common minimum limit for all forms which breaks the test suite which uses a 5 char password by default. :-). As 5 chars seem sensible enough to enforce (people should be picking much longer ones anyway), just reduce the limit to 5 chars, thereby making all tests pass. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Normalize the email address in the same way in all placesSebastian Spaeth2013-01-211-0/+13
| | | | | | | | | | | | | | | | | | We were case normalizing the email address for registration, but not at all for the forgotten password retrieval. Make a tools.mail.normalize_email helper that can be used to normalize the email in the same way in all places. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Merge remote-tracking branch 'refs/remotes/spaetz/436_celery_push'Christopher Allan Webber2013-01-204-45/+65
|\ \
| * | Don't pass request into run_process_mediaSebastian Spaeth2013-01-154-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-154-45/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Sanitize slug input on media editSebastian Spaeth2013-01-181-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we allowed EVERYTHING, even slashes as slug when editing the media. Make sure we slugify the input to sanitize it. (+ string formdata is unicode, so there is no need to convert it) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | Add (failing) test for editing the slug.Elrond2013-01-181-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test fails, because it tries to set a slug with an "=" in it. And tests that the "=" gets replaced by "-". Well, it currently is not being replaced. The next (cherry picked) commit by Sebastian Spaeth fixes this test!
* | | Enable foreign key checking on sqlite.Elrond2013-01-181-1/+12
| | | | | | | | | | | | | | | | | | sqlite normally does not check foreign key referential integrity. But it can do so. So let's use it. Better safe than sorry.
* | | Turn comment list into a real <ul>.Elrond2013-01-181-8/+11
| | | | | | | | | | | | | | | | | | Well, I like semantic html. And the list of comments, well, is now a list: <ul>. Using list-style:none it looks nearly the same as before.
* | | Add some simple collection test.Elrond2013-01-182-1/+59
| | |
* | | Rename get_test_app to get_app.Elrond2013-01-1812-32/+32
| | | | | | | | | | | | | | | | | | | | | nosetests runs everything that even vaguely looks like a test case... even our get_test_app. And as it is imported everywhere... it is run everywhere as a test case. Renaming it saves us about 10+ tests and a few seconds of time.
* | | Remove useless spaces in comment stuff.Elrond2013-01-171-4/+4
| | | | | | | | | | | | | | | | | | | | | When rendering a comment, we had a lot of whitespace. And some of it made it into the rendered page: """<a href=...>abc </a>""" the trailing space gets rendered and looks ugly.
* | | Translate account deletion.Elrond2013-01-172-4/+10
| | | | | | | | | | | | | | | Mark all the strings in the new account deletion stuff for translation.
* | | Fix linking to comments.Elrond2013-01-172-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when linking to a comment in a MediaEntry, the page did not contain a <a name="comment"> because, well: We fetched a string comment-id from the routing. And the pagination code tried to compare that to the int id on the comment. Fix is to let routing fetch an int from the url. Easy. Relatedly remove duplicated comment_id fetching from the URL in the view.
* | | Merge branch 'master' of gitorious.org:mediagoblin/mediagoblinChristopher Allan Webber2013-01-175-6/+12
|\ \ \
| * | | Return to media collection page if no collection selectedSebastian Spaeth2013-01-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | schendje rightly pointed out that we should not return to the media homepage if we did not select a collection on the "collect" page, but should actually return to the collect page. This is an improvement of the user experience ;-) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | Move workbench into tools directory.Elrond2013-01-173-2/+2
| | | |
| * | | Remove DEFAULT_WORKBENCH_DIR.Elrond2013-01-171-4/+0
| | |/ | |/| | | | | | | | | | We never used this. Removed, as okayed by cwebber.
| * | Add "Browse collections" link to profile pagesJef van Schendel2013-01-171-0/+6
| | |
* | | Merge remote-tracking branch 'refs/remotes/spaetz/565_workbench_cleanup'Christopher Allan Webber2013-01-171-41/+21
|\ \ \ | |/ / |/| |
| * | Do not read complete videos in RAM (#419)Sebastian Spaeth2013-01-161-41/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were reading the complete "medium" "thumbnail" and "original" in RAM via dst.write(src.read()). Just call the appropriate storage methods copy_local_to_storage which are responsible for streaming local files efficiently. The efficiency of this patch depends on the separate branch that actually implements chunked copying for Storage().copy_local_to_storage()
* | | adding back dropdown.js now that we have, well, a dropdown again :)Christopher Allan Webber2013-01-171-0/+3
| | |
* | | Merge remote-tracking branch 'refs/remotes/origin/533-new-dropdown'Christopher Allan Webber2013-01-174-47/+80
|\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/templates/mediagoblin/base.html mediagoblin/templates/mediagoblin/root.html
| * | | CSS edits to dropdown menu; added log out button for unverified usersJef van Schendel2013-01-172-13/+10
| | | |
| * | | Add header_dropdown.jsJef van Schendel2012-12-041-0/+27
| | | |
| * | | Edit header styling (add border-bottom, remove background-color); add margin ↵Jef van Schendel2012-12-041-2/+5
| | | | | | | | | | | | | | | | to header_dropdown
| * | | Fix header width again: this is a better approachJef van Schendel2012-12-021-2/+2
| | | |
| * | | Fix header width issue on small screensJef van Schendel2012-12-021-0/+1
| | | |
| * | | Fix small user errorJef van Schendel2012-12-021-1/+1
| | | |
| * | | Give elements proper, more descriptive class namesJef van Schendel2012-12-021-3/+3
| | | |
| * | | Several edits to header dropdown:Jef van Schendel2012-12-021-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Style the up/down arrow as a button - Remove the Actions header - Remove redundant original "Add media" button - Style "Add media" and "Create new collection" links as buttons
| * | | First commit to add header dropdownJef van Schendel2012-12-023-28/+34
| | | |
* | | | Merge commit '9408938' from 565_workbench_cleanup (spaetz)Christopher Allan Webber2013-01-178-43/+96
|\ \ \ \ | | |/ / | |/| |
| * | | Add @get_workbench testSebastian Spaeth2013-01-161-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | Test the decorator function and proper cleanup after it's usage. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | Shorten Workbench(Manager) method namesSebastian Spaeth2013-01-163-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) destroy_self() is a horrible function name, make it "destroy". workbench.destroy() is descriptive enough. 2) WorkbenchManager.create_workbench() -> WorkbenchManager.create() We use the pattern "with workbench_manager.create() as workbench:" No need to mention workbenches three times in a row... Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | Switch over media processor to use the get_workbench decorator (#565)Sebastian Spaeth2013-01-165-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes workbench getting more convenient by eliminating some boilerplate and more robust by cleaning the workbench up even if processing ends with an Exception. Finally, this fixes the bugs in the ascii and video backends to never call workbench.destroy, so those workbenches were never cleaned up. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | Implement @get_workbench decoratorSebastian Spaeth2013-01-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This passes in a Workbench() via the 'workbench' keyword argument, and conveniently cleans it up after the function has finished. 2 out of our 5 backends forgot to clean up their workbench, so this is clearly needed :-). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * | | Make Workbench() a context managerSebastian Spaeth2013-01-161-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to use "with Workbench() as foo: do_stuff..." No consumers have been switched yet though. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | Change position of "Delete account" link, put it below the formJef van Schendel2013-01-172-6/+10
| | | |
* | | | Better "delete my account" placementSebastian Spaeth2013-01-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the "delete my account" link location by not placing it outside the main content bar. It still might require more tweaks. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | Introduce user_deletion test.Sebastian Spaeth2013-01-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete a user via web interface and see if it works. TODO: this does not test that related entries are also cleaned up and we should extend the test to do so. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | Allowing to delete a user account (#302)Sebastian Spaeth2013-01-174-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a "Delete user account" template and link to it from the user account settings page. Create a delete_account function and fill in most blanks. We can now successfully delete our own account. Thanks to Elrond for catching a stray csrf_exempt in a previous iteration of this patch. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | import db.sql.util -> db.utilSebastian Spaeth2013-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging an old branch, I reintroduced an import of db.sql.util rather than db.util. Fixing the glitch. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | | | Merge branch '540_User_delete_deletes_related_entries'Sebastian Spaeth2013-01-172-21/+69
|\ \ \ \ | |/ / / |/| | |