Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/sw 300 software update refresh issue #1447

Open
wants to merge 4 commits into
base: rc/beta
Choose a base branch
from

Conversation

khaledsherkawi
Copy link
Contributor

No description provided.

@@ -1,5 +1,7 @@
<script lang="javascript">
var BEAMOS_VERSION = "{{ beamosVersionNumber }}";
// PLUGINS_VERSIONS is set by single quotes since "pluginVersions" is returning a JSON dump which will break with double quotes
var PLUGINS_VERSIONS = '{{ plugins_versions }}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using quotes you could try to use some of flask filters to make it easier. They seem to be pretty powerful.
Here is an example that would match this needs using tojson and safe https://stackoverflow.com/questions/24719592/sending-data-as-json-object-from-python-to-javascript-with-jinja
You would also need to remove the json.dumps call on the initialisation.

software_info = None

try:
plugin_info = self._plugin._plugin_manager.get_plugin_info("softwareupdate")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is softwareupdate_plugin_info right?

This is also the only place where we need the plugin... I don't think we need to store a reference to the plugin from the DeviceInfo. It seems like to initialise this class we need to pass any plugin to it... Doesn't feel like it belongs here... If we need the softwareupdate info I think we should directly pass it in the constructor.
Another flag that shows that this is smelly is that we are directly calling the _plugin_manager which is a private variable which means it shouldn't be used outside of its own class.

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

Successfully merging this pull request may close these issues.

2 participants