• 
      

    Fix the extension 'enabled' state in the API after enabling/disabling.

    Review Request #5969 — Created June 10, 2014 and submitted — Latest diff uploaded

    Information

    Djblets
    release-0.8.x
    8901add...

    Reviewers

    A recent regression caused ExtensionResource's 'enabled' state to be
    incorrect after enabling/disabling an extension. The value would be that
    of the old state. This led to an unexpected combination of states in the
    extension list, which caused the "Enable", "Disable", etc. actions to
    disappear.

    The reason this happened is that get_object() now caches results, and
    ExtensionResource was attempting to use it in order to reload the
    RegisteredExtension instance. We now reload it like all other resources
    do, which is to just re-fetch from the database using the existing
    instance's ID.

    Enabled and disabled extensions. Saw the links appear and reflect the
    correct state.

    Checked the resulting payload from the API, and it too had the right state.