| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Only when creating a new media_data row, we need the table.
So load that locally in media_data_init().
|
|
|
|
|
|
|
|
|
| |
For all our media_types, let the backref on the media_entry
be a scalar (there is only one media_data per media_entry)
instead of a list with zero or one entry.
The media_data toolchain on MediaEntry currently handles
both transparently.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of doing query by hand, use the relationships on
the models to find the media_data. Is is made possible by
the BACKREF_NAME in each models.py, which lets us know the
local attr to ask for.
Also initialize the relationship attribute on new
media_data instead of the media_id. Also do not add it to
the session. This gives us:
- This automatically initializes the other side of the
relationship, which will allow later acces via that way.
- If the media_data is too early in the session, when the
(new) media_entry is not yet in there, this could get
conflicts. Avoid those by not adding to session.
- Uses cascading to commit media_data together with the
media_entry.
|
|
|
|
|
|
|
|
| |
One in the submissions, that posts a jpg with gps data.
One in the modelmethods to test some behaviours.
The later test fails.
Fixes coming up.
|
| |
|
| |
|
|
|
|
| |
auto module documentation.
|
|
|
|
| |
Tells how you *can* use it in templates if you really like.
|
| |
|
|
|
|
| |
method
|
| |
|
| |
|
|
|
|
| |
in default config
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
| |
- 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. :)
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Do not commit so often. flushing is enough.
|
|
|
|
| |
well, fix the relationship on the comments.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Added the documentation (which was already present in
plugindocs/) to the TOC, so it's getting build and linked.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Also changed some literal blocks to code-blocks
|
|
|
|
|
| |
(This changed in master while this test was being written; correcting
post-merge.)
|
|\ |
|
| |
| |
| |
| |
| |
| | |
- fixed some issues with "whacking uuid junk on the slug"
- uuid4() -> uuid.uuid4() so that mock will work right
- added all the tests!
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
.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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
- 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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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!
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
When deleting a User, his/her collections can be deleted by
sqlalchemy: Collections do not need any special code to be
executed on deletion.
|
| | |
|
| | |
|
| |
| |
| |
| | |
- Changed the default to BICUBIC instead of previous ANTIALIAS
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 fields are always existent, so there is no need to .get() them,
just use them directly.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
|
|\ \
| | |
| | |
| | | |
into mergetest
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
|\ \ \ |
|