Pablo Vazquez
479a435ec5
Work in progress in blurring asset preview and minor CSS/template cleanups
2018-03-21 20:15:29 +01:00
Francesco Siddi
d30a11c8f7
Do not index a document if it's empty
...
The prepare_node_data function returns an empty dict if the node
is not of the INDEX_ALLOWED_NODE_TYPES, or if it's not published, etc.
2018-03-21 02:17:58 +01:00
Francesco Siddi
67a24e9d4e
Provide debug log info when nodes are not indexed
2018-03-21 02:15:46 +01:00
Francesco Siddi
2bf0bf1064
Formatting
2018-03-21 02:15:07 +01:00
Francesco Siddi
678f72766e
Change elif to if _validate_config
...
Elif is not needed after a raise.
2018-03-20 10:05:17 +01:00
Francesco Siddi
66e4229b9b
Merge branch 'production'
2018-03-18 20:14:17 +01:00
Francesco Siddi
99e0eb7a7a
Require SERVER_NAME in the configuration
...
Since we rely more and more on the presence of SERVER_NAME in the
configuration, we make it a hard requirement, before checking if it is
a FQDN.
2018-03-18 18:53:08 +01:00
Sybren A. Stüvel
6a0e0721e9
Require SERVER_NAME to be a FQDN with TLD
...
A fully-qualified domain name, including a top-level domain name, is
required for Chrome to accept session cookies. For more info, see
https://stackoverflow.com/questions/27254013/why-does-the-session-cookie-work-when-serving-from-a-domain-but-not-when-using-a#27276450
2018-03-15 11:39:20 +01:00
Francesco Siddi
97091457a8
Check for capabilites instead of roles in allow_link
2018-03-14 22:05:00 +01:00
Pablo Vazquez
6f69fe5b8a
CSS: Style kbd tag in node description
2018-03-14 21:59:50 +01:00
Pablo Vazquez
7292c534ed
Fix scrollToLinkedComment()
...
The test was done against location.hash, which contains a hash symbol.
Strip it for the test.
2018-03-14 21:59:50 +01:00
Sybren A. Stüvel
df6297d40f
Fixed project search
...
The project ID wasn't used at all when searching in a project's context.
2018-03-13 12:24:29 +01:00
Sybren A. Stüvel
257793dcd5
Simplified some code
2018-03-13 12:21:41 +01:00
Pablo Vazquez
6e1d255dfc
CSS: Style buttons with 'disabled' class
2018-03-11 23:40:23 +01:00
Pablo Vazquez
f236845374
CSS Login: Minor tweaks and maintenance
2018-03-07 21:16:35 +01:00
Sybren A. Stüvel
450dde56b7
Pass our OAuth2 client ID to Blender ID when validating tokens
...
This is a security measure, as it ensures that valid Blender ID OAuth2
tokens that were not generated for Blender Cloud are rejected.
2018-02-21 10:49:33 +01:00
Sybren A. Stüvel
854bc7cfaf
Sentry: include extra user information
...
We perform authentication of the user while handling the request,
but Sentry calls get_user_info() in a before-request handler. This means
that Sentry would miss user info in many cases. This fixes that.
2018-02-14 13:52:52 +01:00
Sybren A. Stüvel
0c7abdb99a
Avoid error when there is no #cloud-search element
2018-02-14 10:22:13 +01:00
Sybren A. Stüvel
b10369a867
Removed unused imports
2018-02-13 16:51:42 +01:00
Sybren A. Stüvel
05187cacea
Add comment to config.py to point at SERVER_NAME
2018-02-13 16:51:28 +01:00
Sybren A. Stüvel
f79642d69f
Refuse to merge projects when SERVER_NAME is unset
2018-02-13 16:50:37 +01:00
Sybren A. Stüvel
1f2fb774b4
Converted another datetime.utcnow() to utils.utcnow()
2018-02-13 16:50:11 +01:00
Sybren A. Stüvel
de801e41e3
CLI command for moving all nodes+files to another project
...
`manage.py operations merge_project src_url dst_url` moves all nodes and
files from the project with `src_url` to the project with `dst_url`.
This also moves soft-deleted files/nodes, as it ignores the _deleted
field. The actual files on the storage backend are copied rather than
moved.
Note that this may invalidate the nodes, as their node type definition
may differ between projects. Since we use direct MongoDB queries the
nodes are moved to the new project anyway. This allows for a
move-first-then-fix approach).
2018-02-13 15:52:21 +01:00
Sybren A. Stüvel
cd42ce6cba
Moving blobs between nodes now uses storage API
...
Instead of only being GCS-specific, it now works for all storage
backends.
2018-02-13 15:36:11 +01:00
Sybren A. Stüvel
eb18e5b933
Formatting
2018-02-13 14:36:23 +01:00
Sybren A. Stüvel
350cf85cd2
Removed unused imports
2018-02-13 14:36:16 +01:00
Sybren A. Stüvel
f2888069db
Added pillar.api.utils.utcnow() which returns a datetime for 'now'
...
This replaces pillar.web.utils.datetime_now() and can be used in a wider
setting (since we don't import web stuff in the api, but we do vice versa).
2018-02-13 14:36:05 +01:00
Sybren A. Stüvel
d0520484bb
User admin: Show selected user as 'active'
2018-02-13 10:24:49 +01:00
Sybren A. Stüvel
d114b5631a
User admin: removed cancel button
...
It didn't do anything useful, but did break the GUI.
2018-02-13 10:21:43 +01:00
Sybren A. Stüvel
ce33ce994f
Elastic: Allow resetting and reindexing in one CLI command
...
Use `manage.py elastic reindex [indexname] --reset` to reset first and then
reindex.
2018-02-13 10:19:05 +01:00
Sybren A. Stüvel
05d5882c68
Remove deploy.sh
2018-02-02 12:47:47 +01:00
Sybren A. Stüvel
0c238284b0
Typo
2018-02-01 15:18:43 +01:00
Sybren A. Stüvel
d85c45f10f
Not using let in JS, as Gulp minify doesn't understand it :(
2018-02-01 14:28:12 +01:00
Sybren A. Stüvel
06b2adf923
Added all the in-use texture map types to the texture node type
...
Note that we now name 'occlusion' (as it's used in production) as
'ambient occlusion'. The database needs to be migrated for this.
2018-02-01 14:13:50 +01:00
Sybren A. Stüvel
1ca2f336c4
Proper error handling for node type editor
2018-02-01 14:13:01 +01:00
Sybren A. Stüvel
284873ddd4
Unify and simplify texture map type labels
2018-02-01 12:04:12 +01:00
Sybren A. Stüvel
d86c215c34
More texture map types
...
These are actually in use in production.
2018-02-01 11:10:16 +01:00
Sybren A. Stüvel
1b57b333df
Removed the URLer service
...
We don't have a need for it any more, so it can go.
2018-01-31 14:33:41 +01:00
Sybren A. Stüvel
08a814525b
Implement project undelete as PATCH
...
This is done via a custom PATCH due to the lack of transactions of MongoDB;
we cannot undelete both project-referenced files and file-referenced
projects in one atomic operation.
2018-01-31 14:15:23 +01:00
Sybren A. Stüvel
27153bd74a
Remove use of URLER service, replaced it with direct MongoDB query.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
20d80dee61
cache_for_request should take function itself into account too
...
Previously it only looked at the arguments to the function, but not the
function itself.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
ca7d528c85
Mass-attaching project pictures for /p/ endpoint
...
Previously we did an API call for each picture_square and picture_header
for each project listed in /p/. Now we do one API call that fetches only
the pictures needed, in one go; in other words, it fetches less data in
less HTTP calls.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
f8ff30fb4d
(un)delete on project also (un)delete file documents.
...
Note that undeleting files cannot be done via Eve, as it doesn't support
PATCHing collections. Instead, direct MongoDB modification is used to set
_deleted=False and provide new _etag and _updated values.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
7d1b08bf58
refresh_links_for_backend: log to backend-specific child logger.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
60abf6d4a9
on_pre_get_files: remove refresh of files
...
It is possible to perform a GET request that has an empty `lookup`
param, like {'_id': {'$in': ['objectID1', 'objectID2', ...]}}. Such a
request would cause a refresh of *all* file documents, which is far too
heavy to do in one client HTTP request.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
7c384d1f45
Link refresh: allow refreshing links for soft-deleted projects.
...
Since files aren't deleted (yet) when projects are deleted, it can happen
that a file is refreshed but then cannot reference a deleted project.
By removing the project ID from the PATCH, Eve doesn't have enough info to
check this, and it'll work fine.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
f18d5580c1
Fixed unicode/bytes issues in CDN file path hashing.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
9177f77e69
Link refresh: gracefully handle case where 'file_path' is not set.
...
In this case an error is logged and the entire link regeneration is
aborted. In other words, variations aren't refreshed either.
2018-01-31 10:08:17 +01:00
Sybren A. Stüvel
4b5a961e14
Speed up authentication by trusting g.current_user if set.
2018-01-31 10:08:17 +01:00
Francesco Siddi
ed1e348d67
Display publishing status of a texture node only to editors
2018-01-26 16:11:56 +01:00