aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Removing unused geolocation_map_visible variable and turning geolocation on ↵Christopher Allan Webber2013-01-302-4/+1
| | | | in default config
* Geolocation stuff, including including templates seems to be working-ishChristopher Allan Webber2013-01-307-8/+105
| | | | | | | - I'm having trouble seeing if the geolocation stuff actually works, but plugins are included - including a list of template hooks works, however the macro to include them does not, so it's kinda verbose
* Very start of plugin hooks and openstreetmap pluginificationChristopher Allan Webber2013-01-304-9/+40
| | | | | | | | - Added start of template hook code to pluginapi.py - Started to break openstreetmap into plugin; moved templates - Added plugin hooks in media and image media templates ... almost certainly, none of this works yet. :)
* Better Py3 compat: d.has_key(k) -> k in dElrond2013-01-305-26/+14
| | | | | | | | py3 does not have dict.has_key any more. You have to use "key in dict" instead. As that works in python2 as well, let's use that. Also some small bits of pep8.
* Improve runtime of one test.Elrond2013-01-291-4/+10
| | | | Do not commit so often. flushing is enough.
* Fix issue 611: Proper (back)relationship on MediaComment.Elrond2013-01-291-1/+7
| | | | well, fix the relationship on the comments.
* Failing testcase for issue 611.Elrond2013-01-292-2/+68
| | | | | | | | | | This currently fails (with foreign key constrain error): 1. Have user A and B. 2. User B creates media M. 3. User A post a comment on M. 4. User A deletes his own account. The test is a little bit wider.
* *docs* intersphinx, exception monitoringJoar Wandborg2013-01-272-1/+48
|
* Docs: Add a database guide to the plugin docs.Elrond2013-01-262-0/+112
| | | | | | Plugin writers will often need to create new tables. So give them some hints, what they need to do and where they might find more info.
* Docs: Create new area for developers.Elrond2013-01-262-1/+11
| | | | | | | | We need some "Part" for developers. Currently, it's named "Part 4: Developer's Zone". But we should come up with a better name soon. Moved the codebase docs in there for starters.
* Add Trim whitespace plugin docs.Elrond2013-01-261-0/+1
| | | | | Added the documentation (which was already present in plugindocs/) to the TOC, so it's getting build and linked.
* Allow doc string extraction and use for pluginapi.Elrond2013-01-263-1/+25
| | | | | | | | Allow us to extract docstrings from our sources using the sphinx.ext.autodoc module. First use: Extract some of the docs for the pluginapi and provide it in a new "Plugin API" section.
* Updated video apt-get to not use globJoar Wandborg2013-01-251-8/+26
| | | | Also changed some literal blocks to code-blocks
* Fix reference of get_test_app->get_app in test_modelmethodsChristopher Allan Webber2013-01-251-2/+2
| | | | | (This changed in master while this test was being written; correcting post-merge.)
* Merge branch '216_cwebber_style_unique_slugs'Christopher Allan Webber2013-01-254-10/+193
|\
| * New mediaentry slug tests now pass!Christopher Allan Webber2013-01-232-3/+134
| | | | | | | | | | | | - fixed some issues with "whacking uuid junk on the slug" - uuid4() -> uuid.uuid4() so that mock will work right - added all the tests!
| * require mock for the new uuid-mocking testsChristopher Allan Webber2013-01-231-0/+1
| |
| * We don't want any empty string slugs, so make "" -> NoneChristopher Allan Webber2013-01-231-0/+4
| |
| * Switching uuid4()[1:4] -> uuid4().hex[:4]Christopher Allan Webber2013-01-231-1/+1
| | | | | | | | | | | | .hex is what we need to access to get at the ascii (hex) version anyway. Also, not sure why the previous version grabbed starting at the index of 1... just grab the first characters instead.
| * Simplifying string concatenation in generate_slug and fixing docstringChristopher Allan Webber2013-01-151-5/+7
| | | | | | | | | | | | | | | | - made the mistake of copying some commit message things into the docstring. Fixed. - elrond points out that += is nicer and we don't need u"" in this case since we're not concatenating a variable, we're concatenating a known ascii string.
| * A revised algorithm for generating slugs.Christopher Allan Webber2013-01-151-11/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This one does not *force* slugs, but usually it will probably result in a niceish one. The end *result* of the algorithm will (presumably, I have not tested it) result in these resolutions for these situations: - If we have a slug, make sure it's clean and sanitized, and if it's unique, we'll use that. - If we have a title, slugify it, and if it's unique, we'll use that. - If we can't get any sort of thing that looks like it'll be a useful slug out of a title or an existing slug, bail, and don't set the slug at all. Don't try to create something just because. Make sure we have a reasonable basis for a slug first. - If we have a reasonable basis for a slug (either based on existing slug or slugified title) but it's not unique, first try appending the entry's id, if that exists - If that doesn't result in something unique, tack on some randomly generated bits until it's unique. That'll be a little bit of junk, but at least it has the *basis* of a nice slug!
| * Need to import uuid4 for generate_slug to totally workChristopher Allan Webber2013-01-151-0/+2
| |
| * Make generate_slug assign a slug in any caseSebastian Spaeth2013-01-151-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | generate_slug could assign "none" as slug. Make sure it assigns a unique slug in any case. We now try based on: a) existing slug values b) media.title c) media.id d) random garbage Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
| * Sanitize slug input on media editSebastian Spaeth2013-01-151-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>
| * Disallow ":" as part of a media slugSebastian Spaeth2013-01-151-1/+1
| | | | | | | | | | | | | | We might want to use "id:IDN" as a special case slug to point to a media's id. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* | Use better relationships to delete collections.Elrond2013-01-231-5/+8
| | | | | | | | | | | | When deleting a User, his/her collections can be deleted by sqlalchemy: Collections do not need any special code to be executed on deletion.
* | Made pil_filters a PIL_FILTERS (global)Joar Wandborg2013-01-221-8/+8
| |
* | Changed sampling filter default to AAJoar Wandborg2013-01-221-2/+2
| |
* | Made the image sampling filter configurableJoar Wandborg2013-01-222-1/+23
| | | | | | | | - Changed the default to BICUBIC instead of previous ANTIALIAS
* | 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
|\ \ \ \