Commit Graph

362 Commits

Author SHA1 Message Date
Benjamin Dauvergne 14c0cbe157 debian: add dependency on graphicsmagick-imagemagick-compat (#15857) 2018-04-11 11:47:53 +02:00
Benjamin Dauvergne ee69dda58b locale: fix difference in newline ending between msgid and msgstr (#22934) 2018-04-10 10:23:11 +02:00
Benjamin Dauvergne 6cca9e9165 publish occupancy (#16828)
As an absolute size, as a ratio of the max size and as a percentage of
the max size.
2018-04-09 09:38:32 +02:00
Benjamin Dauvergne 09cd831cf4 squash migrations (fixes #22951) 2018-04-09 09:38:32 +02:00
Benjamin Dauvergne aebddbb7bf admin: add oauth2 models, improve search (fixes #22950)
We also add default ordering on creation_date for most models.
2018-04-09 09:38:27 +02:00
Benjamin Dauvergne a465f2c176 oauth2: add command oauth2-put-document (fixes #22948) 2018-04-09 09:37:21 +02:00
Benjamin Dauvergne 76532ef64a oauth2: add command oauth2-create-client (fixes #22949) 2018-04-09 09:34:25 +02:00
Benjamin Dauvergne cbf2f6132b oauth2: improve views (#22934)
- show client name in confirmation and authorization view
- in document put authorize view show a thumbnail of the new document
  and a link to download it.
- if document is already in the portfolio, still show information on the
  client and document.
- factorize returning of the document.
2018-04-04 15:53:22 +02:00
Benjamin Dauvergne 3650d9d2c2 django-tables2: make it compatible with dj-tables2>=1.21 (fixes #22946)
Since version 1.21 django-tables2 does not pass the surrounding context
in the table template anymore, it's only available through table.context.
2018-04-04 15:53:22 +02:00
Benjamin Dauvergne 48b598000f use sorl-thumbnail (fixes #15857)
It replaces GraphicsMagick, we do not use the templatetag as the files
are private.
2018-04-04 15:53:22 +02:00
Benjamin Dauvergne 3a6a89da48 views: log download actions (fixes #22944) 2018-04-03 15:08:22 +02:00
Benjamin Dauvergne 89987b6bd6 settings: improve defaults (fixes #22947) 2018-04-03 15:08:22 +02:00
Benjamin Dauvergne 3fae61924c urls: allow use of django-debug-toolbar (fixes #22945) 2018-04-03 15:08:22 +02:00
Benjamin Dauvergne 4ecdbada32 fargo: add missing migration (#22682)
We set a default to create the new Document.creation_date field but it's
not part of the real models, this migration revert it.
2018-04-03 10:48:26 +02:00
Serghei Mihai 8b1885ad8e locale: add missing spaces and properly close tag (#22934) 2018-03-30 18:57:28 +02:00
Benjamin Dauvergne c406cee6c3 locale: update french translation (fixes #22934) 2018-03-30 18:47:08 +02:00
Benjamin Dauvergne 49cc5185b2 templates: always wrap tables in div.table-container (fixes #22795)
django-tables2 < 1.1 only wrap table if the there are multiple pages.
2018-03-30 18:05:34 +02:00
Benjamin Dauvergne 89adb5b9e0 locale: update french translation (fixes #22841) 2018-03-30 18:04:10 +02:00
Frédéric Péters 44a52e2c75 templates: add blocks for easier reuse of oauth2 templates (#22923) 2018-03-30 13:51:02 +02:00
Frédéric Péters 38330c324e templates: improve markup of oauth2 pages (#22922) 2018-03-30 13:51:02 +02:00
Frédéric Péters eec8578f8b oauth2: use <button> (#22921) 2018-03-30 13:51:02 +02:00
Frédéric Péters ca0b908387 move oauth2 templates in a fargo/ subdirectory (#22920) 2018-03-30 13:51:02 +02:00
Benjamin Dauvergne 9a824087cc utils: fix make_url() use by list_to_pick view (fixes #22888)
Return callback to pick view takes an url argument, same name as the
first argument to make_url() :/
2018-03-29 17:00:50 +02:00
Benjamin Dauvergne 52929b1d2f migrations: add default date in migration 0015 (#22682) 2018-03-27 21:12:10 +02:00
Benjamin Dauvergne 79fb2f8dcd migrations: add default date in migration 0015 (#22682) 2018-03-27 16:00:08 +02:00
Benjamin Dauvergne 7846a6ab5b dj11: replace deprecated symbols (#22682) 2018-03-27 13:13:44 +02:00
Benjamin Dauvergne 2db8756f48 fargo: prevent pushing the same file many times (#22682)
Bug was discovered because we added the creation_date non-null field as
content_hash is the primary key. When saving a Document with the same
content_hash, Django try to update the existing document by setting
creation_date to NULL which fails.
2018-03-27 13:08:06 +02:00
Benjamin Dauvergne 7089a0fa7e add a fargo-cleanup command (#22682) 2018-03-27 11:20:44 +02:00
Benjamin Dauvergne 23124dbe34 oauth2: use auto_now_add for creation_date fields (#22682) 2018-03-26 15:32:47 +02:00
Frédéric Péters a0a4c7962f oauth2: extend oauth2tempfile uuid to 32 characters (#22782) 2018-03-24 08:30:33 +01:00
Benjamin Dauvergne a102c7d78e models: handle ENOENT from file-magic (fixes #22745)
magic.Magic.file() does not return None or raise an exception on a
missing file, it just return the string "cannot open ...".
2018-03-23 22:44:34 +01:00
Frédéric Péters 666fe66494 oauth2: fix typo in error message (#22713) 2018-03-23 15:56:48 +01:00
Benjamin Dauvergne e98b74dccc oauth2: allow modifications of client_id and client_secret (#22717) 2018-03-22 21:16:46 +01:00
Benjamin Dauvergne c741e8df51 fargo: PE8 (#22717) 2018-03-22 21:16:46 +01:00
Benjamin Dauvergne 59ec2bea1a oauth2: do not use the document hash as primary key for temp files (#22717)
It prevents a client from pushing the same file multiple times, which
makes temporary errors harder to handle (client would have to handle a
failure from the web-service). We allow any number of push of the same
document, orphans will be cleaned up by a background task, and storage
is not duplicated as document are deduplicated through their hash.
2018-03-22 21:15:30 +01:00
Benjamin Dauvergne d813e2b167 oauth2: improve logs with new link to clients (#22717) 2018-03-22 11:47:47 +01:00
Benjamin Dauvergne 1dddba4baf oauth2: link authorizations and temp files to clients (#22717) 2018-03-22 11:47:47 +01:00
Benjamin Dauvergne 1803cb9ddf oauth2: log more (#22717) 2018-03-22 11:47:47 +01:00
Benjamin Dauvergne 60d6259023 oauth2: use client_name as unicode value of clients (#22717) 2018-03-22 11:47:47 +01:00
Benjamin Dauvergne fc6119683b share make_url() with fargo, simplify URL building code (#22717) 2018-03-22 11:47:46 +01:00
Benjamin Dauvergne ab4a137c09 oauth2: update french translations (#22717) 2018-03-22 11:47:46 +01:00
Benjamin Dauvergne 49a01aac71 oauth2: remove useless for check redirect_uri in token endpoint (#22717) 2018-03-22 11:47:39 +01:00
Benjamin Dauvergne fbe0fc0b78 oauth2: enforce access_token and code lifetime (#22717) 2018-03-21 23:55:02 +01:00
Benjamin Dauvergne 2fe7382ab3 oauth2: improve coding style (#22717)
* declare all views with .as_view()
* add helper make_url() to properly add parameters to query string of
  redirect_uri
* stop threading the redirect_uri through the session
* make POST form target implicit, so that parameters are kept
* do checks in dispatch() to share them between POST and GET methods
2018-03-21 23:53:40 +01:00
Benjamin Dauvergne d5608c7478 oauth2: always delete the temp document on a POST (#22717) 2018-03-21 23:53:40 +01:00
Benjamin Dauvergne 114e474d4c oauth2: fix typo (#22717) 2018-03-21 23:53:40 +01:00
Benjamin Dauvergne 0ec6e92235 oauth2: add localization (#22717) 2018-03-21 23:53:40 +01:00
Benjamin Dauvergne db69542403 oauth2: remove unused import (#22717) 2018-03-21 23:53:40 +01:00
Benjamin Dauvergne 3d69062edb tox.ini: rename coverage file only if coverage is enabled (#22717) 2018-03-21 23:53:40 +01:00
Benjamin Dauvergne d780a085a9 fix typo "attachement" -> "attachment" (fixes #22676) 2018-03-21 19:03:34 +01:00