1485 Commits

Author SHA1 Message Date
9cce441f6c Removed unused code 2017-09-19 13:38:30 +02:00
6af0cd2be8 Don't show "Create a project" button to non-subscribers, and make btn clickable 2017-09-18 13:51:31 +02:00
82a1e0796c Project Home: Scale header image fit as cover 2017-09-17 21:55:59 +02:00
8d0c0894cb Textures: No background color for download button 2017-09-17 21:55:10 +02:00
b98771f067 Improvements to image thumbnailing
- Optimize JPEGs and increase quality from 75 to 95
- Don't always convert to RGB, first check if RGBA and save as PNG optimized

Thanks to Dr. Sybren and Francesco for review and feedback
2017-09-17 21:49:55 +02:00
b2cfe46438 Style tweaks on projects
Plus re-ordering and minor cleanup
2017-09-17 20:11:13 +02:00
53ac29cfd1 Project: Show edit button in sidebar
So we can access it from everywhere and not only from project home
2017-09-17 20:11:13 +02:00
4e153413d9 Fix Download button showing when not logged in 2017-09-17 20:11:13 +02:00
Dalai Felinto
7d48c02fa3 Expand user schema to support extension_props 2017-09-17 00:25:09 +02:00
5df68c4ead Comments: Only show if there are actually comments
No negative text "no comments"
2017-09-16 20:11:50 +02:00
1563f4142d Fix broken layout on project blog posts
Fixes T52764
2017-09-16 20:11:50 +02:00
1177f516ba Set status as 'published' when creating a blog
If a blog is not set as published it won't be visible in the navbar.
2017-09-16 19:20:12 +02:00
2d18057c6e Added DB index for latest assets/comments 2017-09-15 17:09:15 +02:00
970376ed56 Removed debug print 2017-09-15 17:04:23 +02:00
e2ea8d491b Added a bit of input validation 2017-09-15 16:50:27 +02:00
62954ac157 Latest assets/comments: using Mongo aggregation instead of Python code 2017-09-15 16:47:40 +02:00
1c70d80b99 Removed unused imports 2017-09-15 15:26:43 +02:00
dc50d6e941 Add more logging to find cause of KeyError
There can be a KeyError accessing permission['methods'], but our current
logging doesn't provide enough information as to determine when this
happens. Rather than bluntly fixing the issue, I added logging to try and
find out how we get a 'methods'-less permission dict in the first place.
2017-09-15 11:02:31 +02:00
8377dc63c0 Fix attribute error accessing response.text
The response object *should* be a requests.Response object, which *should*
have a .text property. However, there are situations where this is not the
case, and in those cases we now won't produce an AttributeError.
2017-09-15 10:06:06 +02:00
54bb506e10 Orphan finder: also interpret 24-char hex strings as ObjectIDs
This is necessary as some dynamic node properties have ObjectIDs saved
as strings.
2017-09-14 17:43:23 +02:00
d4facbf2e3 Orphan finder: store the orphan-files.txt file in STORAGE_DIR
This allows running the orphan finder inside a docker container.
2017-09-14 17:34:02 +02:00
ddc8fc0f5e Clarify celery beat schedule a bit 2017-09-14 17:15:11 +02:00
82d2921424 Added support for periodic Celery tasks.
You have to run "manage.py celery beat" for this to work too. Run
"manage.py celery beat -- --help" to get CLI option help.
2017-09-14 16:00:59 +02:00
5d137ac997 Added Celery task for refreshing file links
This includes a CLI command to kick off a single run for the Celery task.

This does *NOT* include a check to see whether the task is already running!
2017-09-14 15:12:25 +02:00
b06e17acf0 Added a little reminder about what to do when you add a Celery module 2017-09-14 15:10:54 +02:00
c272b5d4bb refresh_backend_links CLI: don't convert str → int multiple times 2017-09-14 15:10:32 +02:00
eba28b4eb4 File link refresh: report on every N refreshed links
This makes it easier to see what the Celery worker is actually working on
when refreshing a large number of links.

It'll report on every N refreshed links, where N = link_count/25 but
clamped to N ∈ [5, 100]
2017-09-14 15:10:09 +02:00
44f473221f File link refresh: ignore soft-deleted files 2017-09-14 15:06:37 +02:00
3be47056a0 Orphan finder: drop the per-project finding
Overall finding is much faster, at the expense of a bit more RAM.
2017-09-14 12:18:10 +02:00
be6746f7ab Fixed bug when parsing node without content type property 2017-09-14 12:09:54 +02:00
8cb506731f find_for_other: fail early when no project is given 2017-09-14 12:08:32 +02:00
e09649586f find_url_for_node: fail early when node has no valid project 2017-09-14 12:08:08 +02:00
230c15d51c Fix snag that happens when PUTting a user document without roles key. 2017-09-14 11:23:35 +02:00
c4a765e73b Change url of EXAMPLE_PROJECT
This prevents tests from breaking as we start implementing the concept of 'main' project.
2017-09-13 23:30:23 +02:00
18eb84fa9d Log capabilities at DEBUG level. 2017-09-13 16:36:36 +02:00
1a505bb0a2 Work around bugsnag issue
3263f0a551b663f93d1f2ec8087ef43302752f8b didn't fix it in production.
2017-09-13 16:36:29 +02:00
86caa3a044 Fixed inconsistency between requirements.txt and setup.py 2017-09-13 16:36:01 +02:00
3263f0a551 Upgraded bugsnag 2.3.1 → 3.1.1
I hope this fixes this error; I no longer see it locally:

Traceback (most recent call last):
  File "/data/git/blender-cloud/runserver.wsgi", line 16, in <module>
    application = PillarServer(my_path)
  File "/data/git/pillar/pillar/__init__.py", line 96, in __init__
    self._config_bugsnag()
  File "/data/git/pillar/pillar/__init__.py", line 191, in _config_bugsnag
    handle_exceptions(self)
  File "/opt/python/lib/python3.6/site-packages/bugsnag/flask/__init__.py", line 27, in handle_exceptions
    got_request_exception.connect(__log_exception, app)
  File "/opt/python/lib/python3.6/site-packages/blinker/base.py", line 130, in connect
    sender_ref = reference(sender, self._cleanup_sender)
  File "/opt/python/lib/python3.6/site-packages/blinker/_utilities.py", line 134, in reference
    weak = callable_reference(object, callback)
  File "/opt/python/lib/python3.6/site-packages/blinker/_utilities.py", line 145, in callable_reference
    return BoundMethodWeakref(target=object, on_delete=callback)
  File "/opt/python/lib/python3.6/site-packages/blinker/_saferef.py", line 135, in __new__
    key = cls.calculate_key(target)
  File "/opt/python/lib/python3.6/site-packages/blinker/_saferef.py", line 196, in calculate_key
    return (id(get_self(target)), id(get_func(target)))
  File "/opt/python/lib/python3.6/site-packages/events/events.py", line 41, in __getattr__
    (self.__class__.__name__, name))
AttributeError: type object 'PillarServer' has no attribute '__self__'
2017-09-13 16:03:38 +02:00
8aa6bb61dd Slightly nicer initialisation of Bugsnag 2017-09-13 16:02:48 +02:00
f89bec5089 Allow <pre> tags in comments
This is useful for code blocks.
2017-09-13 15:34:36 +02:00
896784a351 Clear session when token is invalid
Before this, the user's authentication token would still be stored in
the session even when it's found to be invalid. This caused a login
action to fail, but not in such a way that we would redirect to the login
page of Blender ID. Rather, it would keep you not logged in. By clearing
the session we're sure that the invalid token is forgotten, and the next
request will handle the login properly.
2017-09-13 15:23:38 +02:00
6488f4677e Be more graceful when URLer service isn't configured properly.
Errors are still logged, but find_url_for_node() will just act as if the
node doesn't exist when the URLer authentication token is invalid.
2017-09-13 15:22:04 +02:00
f650835c07 Orphan finder: soft-delete orphan files
This uses the orphan-files.txt file output by find_orphan_files() to
mark those files as deleted. This allows for a two-stage approach, where
file IDs are found on one machine (against a read-only MongoDB slave, for
example) and soft-deleted on another machine (against a writable master).
2017-09-13 14:05:28 +02:00
33feaa81ca Orphan finder: refuse to find orphans when orphan-files.txt exists. 2017-09-13 14:05:28 +02:00
16bf193b0e Added soft-delete to the files schema.
This allows us to soft-delete orphan files, at least until we know
that the orphan file detection is solid and can really be trusted.
2017-09-13 14:05:28 +02:00
ce59bc3335 Orphan finder: write file object IDs to orphan-files.txt 2017-09-13 14:05:28 +02:00
46d834f5aa Orphan finder: log duration of orphan file search 2017-09-13 14:05:28 +02:00
4be05c8b57 Orphan finder: when iterating all projects, gracefully stop at CTRL+C 2017-09-13 14:05:28 +02:00
5ce02bbbfe Orphan finder: fix bug when no orphan files are found 2017-09-13 14:05:28 +02:00
d01b498ad5 Orphan finder: Default project._deleted to False 2017-09-13 14:05:28 +02:00