Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Reduce WebApp views complexity (in instrument.views.variables) #185

Open
Pasarus opened this issue Aug 18, 2022 · 0 comments
Open

Reduce WebApp views complexity (in instrument.views.variables) #185

Pasarus opened this issue Aug 18, 2022 · 0 comments

Comments

@Pasarus
Copy link
Member

Pasarus commented Aug 18, 2022

Issue raised by: [developer/user/project requirement]

This may have been resolved unintentionally! Investigate before committing work.

What?
There's a couple of views in the WebApp that render other views inside them. This isn't great as the stack trace seems to be quite bad when something fails in the view that's being rendered inside the main view. DEBUG_PROPAGATE_EXCEPTIONS = True helps a bit, but the result is a huge traceback that's hard to read.

Where?
The two that come up with grepping {% view are:

{% view "instrument.views.variables.summarize_variables" instrument=instrument.name last_run_object=last_instrument_run %}
{% view "instrument.views.variables.render_run_variables" instrument run_number run_version %}

Possible solution
I think a better approach is to include templates, but gather all the information in 1 view. We don't actually do LESS work when we split the view, we do just the same amount of querying anyway.

There's also some potential for reducing query duplication and optimising, as we can comprehend what's happening when it's in one place a lot better than when it's split into two, and we can share the objects.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant