open-craft/edx-platform — pull request #6 by bradenmacdonald (2014-10-31 08:47:22+00:00)
Title: Content libraries settings overrides

Changes split mongo behaviour so that XBlock fields with Scope.settings can have their `default` overriden in the definition. This adds a new `defaults` object to each definition in split mongo.

Problem is that the definitions are often lazy-loaded, so in order to check if the default is set or not, we sometimes now need to load the definition when in the past it wasn't loaded. This is causing some platform tests to fail because more mongo calls are used than before. Possible solutions:
* Set a has_defaults flag on the structure - this is what I have done for now
* Avoid/reduce lazy loading
* Change code to only check for defaults if block is a descendant of a LibraryContentBlock
* Don't allow XBlock fields to be overridden in this way - use some other approach

This is not done yet - I could swear I had it working, but now it doesn't seem to be. In any case, I'm trying to write a few tests to verify its functionality, and they are not yet passing. Comments/advice welcome.

Even once I do get it working, I suspect the implementation may need to be changed significantly after we've had feedback from upstream.