1665 Commits

Author SHA1 Message Date
f47a45f9a3 Removed unused code 2017-12-22 14:42:24 +01:00
8fb22931f5 Remove unused imports 2017-12-22 14:42:18 +01:00
8f9d21cdd8 Fixed bug in parsing jstree
A projection was missing, causing warnings that the node doesn't have a
content type.
2017-12-22 12:29:51 +01:00
054eced7de Added SMTP Auth support 2017-12-22 10:59:15 +01:00
8ca6b4cdb0 Added Celery task for queued email sending.
Upon IOError or OSError (which includes SMTP protocol errors) the mail
sending task is retried after MAIL_RETRY seconds. It is retried three
times (default setting of Celery) only.
2017-12-21 13:17:57 +01:00
01f81ce4d5 Send a Blinker signal when someone's subscription status changes
This is very close to the 'roles changed' signal, with the difference that
it is sent only once for multiple role changes.
2017-12-21 12:59:32 +01:00
ef1609efc2 Added abs_url() Jinja function for proper absolute URLs
abs_url(x) is a shortcut for url_for(x, _external=True,
 _schema=app.config['SCHEMA']), and should be used for all URLs that should
include the hostname and schema.
2017-12-21 12:58:06 +01:00
b7bf29c06e Added user_is_unknown_member() to OrgManager 2017-12-20 14:57:55 +01:00
dab8fbae6d create_new_user_document: allow passing the full name 2017-12-20 13:34:27 +01:00
c545053b85 Declare return type 2017-12-20 13:34:17 +01:00
05ad824dcb Allow UserClass instantiation without database ID
This allows us to inspect the capabilities that would be given to a user,
without actually creating the user in the database first.
2017-12-20 13:34:11 +01:00
92fe39ddac Prevent shadowing of name from outer scope 2017-12-19 10:45:34 +01:00
e0604fc217 Reduce log level for something that's fine
Missing emails can happen when creating a service account, we shouldn't
log a warning for this.
2017-12-15 11:23:16 +01:00
a7693aa78d Switch from macros to blocks for navigation menus
This affects the user and notifications menus. It happens for two reasons:
- the only argument passed to the macros was current_user, which is always available
- we want to enable overriding and adding items to the menus via extensions

At the moment only the user menu takes advantage of the base template, since the blender-cloud extension makes use of it, while notifications.pug does not need it yet.
2017-12-13 11:08:33 +01:00
20ca3f8ee4 Rename blender_id url to blender-id
This fixes a non-compliant to RFC 1178 exception raised by the Django implementation of Blender ID. The issue is debated here https://code.djangoproject.com/ticket/20264.
2017-12-12 18:49:52 +01:00
6d37046933 Fixed "leave shared project" javascript
Now the project is actually removed from the page. This isn't optimal; see
T53546 for a followup.
2017-12-12 11:48:48 +01:00
ae8c6e92fc Fix forced login for user switching 2017-12-12 11:25:32 +01:00
1d1e588d57 Switch: Always follow PREFERRED_URL_SCHEME instead of the request scheme
When getting an _external=True URL, we shouldn't use the scheme of the
current request at all (this depends on HaProxy forwarding the correct
headers, which might fail when misconfigured) and just always use the
preferred URL scheme. This fixes it at least for the user switching,
because Blender ID will refuse to redirect back to a http:// URL.
2017-12-12 10:56:34 +01:00
b77527e9a2 No '…'.format(…) in logging 2017-12-08 14:52:38 +01:00
199c6b1f77 Auth: also support Bearer token authentication
This is commonly used in OAuth-authenticated calls, and can help us break
away from the username-is-auth-token stuff currently in use.
2017-12-08 14:46:58 +01:00
3ea2504e8c Log more information in Sentry 2017-12-08 14:46:01 +01:00
8eee0d57b6 Update token expiry in tests to be a bit more into the future. 2017-12-08 14:03:45 +01:00
8a400c5c0f Gracefully handle users with empty full_name 2017-12-08 14:03:30 +01:00
821f11393c Link to 'edit profile' page on Blender ID directly 2017-12-08 10:42:43 +01:00
ca25078b30 Removed editing of full name from Cloud profile
We take the full name from Blender ID instead.
2017-12-07 17:31:26 +01:00
785145e1c1 Nicer message when username already exists 2017-12-07 17:31:07 +01:00
e1646adff6 More modern use of super() 2017-12-07 17:30:10 +01:00
d20f3d5668 Removed manual bad JSON-encoding 2017-12-07 17:29:49 +01:00
dfc224d8a9 Added capability 'encode-video' and role 'video-encoder'.
Both 'video-encoder' and 'admin' roles get 'encode-video' capability,
which allows users to upload video that gets encoded & displayed as a
video. For users without this capability videos are handled as regular
downloads.
2017-12-07 16:51:16 +01:00
5c7f37a100 Lowered dependency versions to satisfy Eve 2017-12-07 13:02:23 +01:00
fc25ca9c03 Replaced Bugsnag with Sentry - requires config changes!
Note that pillar/bugsnag_extra.py still exists; I'm keeping it around for
a while until we know what info we miss in Sentry, can port it, and then
remove/refactor it.
2017-12-07 12:58:21 +01:00
6c4dd8ae02 Fix T53339: Downgraded Werkzeug 0.12.2 → 0.11.15 2017-12-07 12:44:05 +01:00
9fdcfff4fc Direct users to renewal page on Store instead of /join
/join should only be used when someone can actually buy a new subscription.
/renew should be used when someone already has a subscription that needs
to be renewed.

Since url_for('cloud.xxxx') makes no sense in Pillar, I just hard-coded
/renew instead.
2017-12-06 14:39:30 +01:00
2bcc26860f Removed 'subscriber' cap from 'admin' role
This allows admins to test what happens when users do not have a
subscription. To give the user subscriber capability, just grant demo role
as well.
2017-12-06 12:09:21 +01:00
1e012f860b Registered org-subscriber role so that it shows in the admin 2017-12-06 11:58:21 +01:00
87fe1887e8 Added "Update from Blender ID" button
Added this button in the /u/ user/embed view, so that admins can easily force a re-check from Blender ID without requiring the user themselves to perform any actions.
2017-12-05 11:45:42 +01:00
c8221ea0e4 Simplified javascript in users/edit_embed_base.pug
There is no need to use JQuery, a unique ID for the a-element, and an
invalid href value, just to bind on-click functionality to a link.
2017-12-05 11:44:05 +01:00
517b283893 Accept roles from Blender ID in two formats
This supports {'role_name': bool} dicts (the old format) and any iterable
of strings {'role_name', ...}
2017-12-01 18:10:33 +01:00
0b218eb656 Use Blender ID to obtain subscription status.
Instead of performing a call to the Blender Store, call to Blender ID to
get the user's subscription status.

Currently this is performed as a second HTTP call after logging in; in the
future we may want to include the roles in the login response from Blender
ID, so that we can do this in one call instead of two.
2017-11-30 15:28:35 +01:00
8ba4cc5c0c Allow extension of users/edit_embed.pug
This is done by moving users/edit_embed.pug to users/edit_embed_base.pug,
and having a new users/edit_embed.pug extend that. Projects like Blender
Cloud can then provide their own users/edit_embed.pug and override certain
blocks.
2017-11-29 13:58:47 +01:00
2ad65b0485 Project: Remove collapse of sidebar
Since projects went full-width it's not needed anymore.
2017-11-28 15:36:31 +01:00
ce7754ffe4 Renaming IDs to classes 2017-11-24 19:34:58 +01:00
7252055e4a Markdown: Convert Markdown via Jinja filter in the template
This gets rid of the use of javascript for converting node/post description.
Now we only use markdown.js for real time as-we-type stuff, like node/post
editing or commenting.
2017-11-23 16:49:19 +01:00
c086cff36e Comments: Only load JS for post/edit comments if we can actually comment 2017-11-23 16:40:58 +01:00
eeba87d333 Blog: Unify the looks of blog posts
Now that the render_blog_post macro is shared with the homepage
2017-11-23 16:20:29 +01:00
cb7a23bc69 Fixed home project menu 2017-11-21 14:48:59 +01:00
49a6a6a758 Delete the auth token when logging out.
Before this, authentication tokens were kept in the database, even when
someone logged out. This is unwanted behaviour, as logging in will create
yet another token anyway there is no reason to keep the token around.
2017-11-17 12:10:21 +01:00
491c5e1b8c A bit more margin around iframe on node descriptions 2017-11-10 17:57:52 +01:00
3466320d98 File Upload: Don't clear all upload toastr notifications
Define the toastr on setup and clear only that one once it's finished
2017-11-10 17:57:17 +01:00
0cea8d622d Update cache for CSS/JS 2017-11-09 19:00:01 +01:00