2399 Commits

Author SHA1 Message Date
Ankit
7c238571bf Fix T73490 Hyperlink bug
Fix typo in the link to Blender Cloud

Maniphest Tasks: T73490

Differential Revision: https://developer.blender.org/D7218
2020-03-27 09:52:51 +01:00
7dc0cadc46 Fix issue with Cerberus
Cerberus has a clause `… and X in self.persisted_document`, which fails
when `persisted_document` is `None` (which is the default value for the
parameter). This code can be found in the function `_normalize_default()`
in `.venv/lib/python3.6/site-packages/cerberus/validator.py:922`.
2020-03-19 16:57:50 +01:00
47474ac936 Replaced Gravatar with self-hosted avatars
Avatars are now obtained from Blender ID. They are downloaded from
Blender ID and stored in the users' home project storage.

Avatars can be synced via Celery and triggered from a webhook.

The avatar can be obtained from the current user object in Python, or
via pillar.api.users.avatar.url(user_dict).

Avatars can be shown in the web frontend by:

- an explicit image (like before but with a non-Gravatar URL)
- a Vue.js component `user-avatar`
- a Vue.js component `current-user-avatar`

The latter is the most efficient for the current user, as it uses user
info that's already injected into the webpage (so requires no extra
queries).
2019-05-31 16:49:24 +02:00
8a19efe7a7 Reformatted code and added import to resolve PyCharm warnings 2019-05-31 13:55:06 +02:00
3904c188ac Removed trailing spaces 2019-05-31 13:55:06 +02:00
26e20ca571 Fix for now-allowed PATCH on users
Commit 0f0a4be4 introduced using PATCH on users to set the username.
An old unit test failed, as it checks that PATCH is not allowed (e.g.
tests for 405 Method Not Allowed response).
2019-05-31 10:24:11 +02:00
e57ec4bede Moved user_to_dict() function out of pillar.web.jinja module 2019-05-31 10:23:25 +02:00
3705b60f25 Fixed unit test by doing late import
For some reason the old pillar.auth stuck around, failing the
`isinstance(some_object, auth.UserClass)` check because it compared to the
old class and not the reloaded one.
2019-05-31 10:22:46 +02:00
0f0a4be412 Fixed updating username in settings view
The timestamps used by the 'last viewed' property of the video progress
feature were converted to strings when sending to the frontend, but never
changed back to timestamps when PUTting via the SDK. I solved it by not
PUTing the user at all, but using PATCH to set the username instead.
2019-05-29 18:37:01 +02:00
23f8c1a446 Ran npm audit fix --force
This fixed 64 security vulnerabilities and hopefully didn't break too much.
2019-05-29 17:06:41 +02:00
1f5f781ecf Suppress warnings from Werkzeug
- Werkzeug deprecated Request.is_xhr, but it works fine with jQuery and we
  don't need a reminder every time a unit test is run. When we upgrade to
  Werkzeug 1.0 (once that's released) we'll see things break and fix them.
- Werkzeug deprecated their Atom feed. This we should act on; tracked in
  https://developer.blender.org/T65274.
2019-05-29 15:22:45 +02:00
4425771117 Suppress Cerberus deprecation warning caused by Eve
Eve is falling behind on Cerberus. See my bug report on
https://github.com/pyeve/eve/issues/1278 for more info.
2019-05-29 14:32:46 +02:00
931c29a21f MongoDB: db.collection_names() is deprecated → db.list_collection_names() 2019-05-29 13:46:53 +02:00
2aa79d3f09 MongoDB: more changing count() → count_documents() 2019-05-29 13:46:53 +02:00
6f8fd4cd72 Cerberus 1.3 renamed 'validator' → 'check_with'
This results in a change in schemas as well as in validator function names.
2019-05-29 12:58:40 +02:00
f53217cabf Added some type declarations 2019-05-29 12:58:40 +02:00
8b42e88817 Cerberus 1.3 renamed '{value,key}schema' to '{values,keys}rules'
'valueschema' and 'keyschema' have been replaced by 'valuesrules' and
'keysrules'. Note the change from 2x singular ('value' and 'schema') to
2x plural ('values' and 'rules').
2019-05-29 12:57:38 +02:00
dd5cd5b61a Compatibility with Eve 0.9.1
Note that Eve's update from 0.9 → 0.9.1 had a breaking API change, as the
return type of `app.data.find(...)` changed...
2019-05-29 10:50:55 +02:00
459a579964 Some extra type annotations 2019-05-28 16:13:14 +02:00
0b32e973a9 More thorough retrying in Blender ID communication 2019-05-28 16:13:14 +02:00
c6e70dc5d9 Removed and gitignored poetry.lock
The poetry.lock files are only relevant for repeatable deployments,
and the one in this project isn't used for that (only the Blender
Cloud project file is used, and that's still there).
2019-05-28 16:13:14 +02:00
1b90dd16ae Re-locked dependencies 2019-05-28 16:13:14 +02:00
1e823a9dbe MongoCollection.count() and update() are deprecated
Eve doesn't have any counting methods on `current_app.data`, so there is
no one-to-one translation for `cursor.count()` in
`file_storage/__init__.py`. Since the call was only used in a debug log
entry, I just removed it altogether.

I removed `pillar.cli.operations.index_users_rebuild()`, as it was
importing `pillar.api.utils.algolia.algolia_index_user_save` which doesn't
exist any more, so the code was dead anyway.
2019-05-28 16:13:14 +02:00
47d5c6cbad UnitTest.assertEquals is deprecated, replaced by assertEqual 2019-05-28 16:13:14 +02:00
b66247881b Relaxed required versions of all our dependencies
Some packages were upgraded; the rename from `CommonMark` to `commonmark`
was the only change breaking the unit tests.
2019-05-28 16:13:14 +02:00
90e5868b31 Dependencies: remove requests, it's pulled in via python-pillar-sdk anyway 2019-05-28 16:13:14 +02:00
94efa948ac Development dependencies updates to their latest versions 2019-05-28 16:13:14 +02:00
ec344ba894 Generate Blender ID URL based on configuration 2019-05-23 13:48:24 +02:00
cb8c9f1225 Merge branch 'production' 2019-05-22 10:27:25 +02:00
51ed7a647d put_project(project_dict): also log the error when we cannot PUT
Previously only a ValueError was raised, which was sometimes swallowed.
Instead of looking up the culprit and solving this properly, I just log the
error now.
2019-05-22 10:15:25 +02:00
c396c7d371 Allow web projects to un-attach project pictures
This makes it possible to PUT a project after attach_project_pictures()
has been called on it (which embeds the picture file documents).

This will be used in SVNman.
2019-05-22 10:14:19 +02:00
2d7425b591 Added 'idna' package as dependency
It's required by pyopenssl but for some reason wasn't installed by Poetry.
2019-05-14 11:19:03 +02:00
3f875ad722 Gitignore devdeps metadata directory 2019-05-14 10:42:15 +02:00
9c517b67c5 Documenting use of Poetry for dependency management 2019-05-14 10:42:15 +02:00
dd9a96d111 README: Removed trailing whitespace 2019-05-14 10:42:15 +02:00
3d6ff9a7bc Moving to Poetry 2019-05-14 10:42:15 +02:00
8ba7122a01 Forms: Use own label element for fields instead of wtforms.
This way we can do two things:
* Tag the field for translation
* Use a filter (like undertitle for nicer labels)
2019-04-24 21:29:55 +02:00
15d5ac687c Attach all project pictures when viewing node
The Open Graph rendering code is not completely refactored yet,
so it still requires a mix of project.picture_header and
project.picture_16_9. By attaching all project pictures we prevent
unexpected errors.
2019-04-19 15:30:55 +02:00
402f9f23b5 Use picture_16_9 as og_image
Previously we used picture_header, which did not guarantee a suitable
aspect ratio for an Open Graph image.
2019-04-19 14:12:43 +02:00
486fb20dcf Enhance project with attach_project_pictures
Instead of individually attaching project images, use the utility
function.
2019-04-19 14:11:42 +02:00
34f2372082 Add picture_16_9 when attaching project pictures 2019-04-19 14:10:19 +02:00
c217ec194f Save 16_9 picture via Project edit form 2019-04-19 14:09:54 +02:00
b68af6da8b Rename 16x9 to 16_9
We do this to reduce ambiguity about resolution vs aspect ratio.
2019-04-19 11:50:41 +02:00
06f5bc8f01 Add picture_16x9 attribute for Project
This image can be use as a source for Open Graph tags, as well as for
displaying a project thumbnail with a known (or at least expected)
aspect ratio.
2019-04-19 10:57:46 +02:00
53eb9f30fd Bumped Jinja2 2.10 → 2.10.1
Github poked us about this being a security update.
2019-04-18 10:15:41 +02:00
43d464c60c Fix missing icons. 2019-04-15 12:42:49 +02:00
d0ef76c19e CSS: Utility classes for column count property. 2019-04-12 17:16:06 +02:00
a43eca4237 Timeline: Less prominent project title. 2019-04-10 17:08:14 +02:00
af020d4653 Cleanup CSS.
Extend Bootstrap classes instead of using own styling.
2019-04-10 17:08:01 +02:00
2c207b35e2 UI Asset List: Add custom class to meta items. 2019-04-10 14:14:04 +02:00