Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/user/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ once the device connects to OpenWISP it will download and apply the
default templates without the need of manual intervention from the network
operators.

**Side note:** To be precise, a default template is automatically assigned not
to any new device but to any new device config. So if you have any
device which was registered before a specific template was made a default
template, you can delete its config and create a new one, then the new config
will automatically have all current default templates assigned.
Copy link
Member

Choose a reason for hiding this comment

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

We shall keep in mind this could change: #480.


An organization specific template flagged as default will be automatically
assigned to any new device which will be created in the same organization.

Expand All @@ -116,6 +122,9 @@ unassigned from a device configuration, they can only be overridden.
They will be always assigned earlier than default templates, so they can
be overridden if needed.

Another difference to :ref:`default_templates` is that required templates are
assigned to all devices, not just new devices.
Copy link
Member

Choose a reason for hiding this comment

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

Are you 100% sure of this? I don't remember we added logic to automatically modify existing devices. As far as I remember the required template would be applied only if the user saves the device object.

Copy link
Member Author

@okraits okraits Mar 14, 2025

Choose a reason for hiding this comment

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

I didn't see it in the code but I noticed that a required template had been marked as assigned (with its checkbox disabled) in all devices after the template was made required. I didn't create a new device at all.

That's why I thought that adding this information to the docs would be useful as this is a clear difference in behaviour compared to default templates.

Edit: this comment #480 (comment) puts some doubt on it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Trying to investigate the current behaviour, I did the following:

  1. Create two devices, in different orgs. None has a template assigned.
  2. Create four templates, two in each org. In each org one template is a default template and one is a required template.
  3. Create two shared templates. One is a default template and one is a required template.
  4. Create two more devices, one in each org.

Then the situation is as follows:

  • The first two devices have two templates assigned each. The one required template of their org and the one shared required template.
  • The second two devices have four templates assigned each. Two required templates (one of their org and one shared) and two default templates (one of their org and one shared).

So my previous observation and my additions to the docs match my tests.


In the example above, the "SSID" template is flagged as "(required)" and
its checkbox is always checked and disabled.

Expand Down
Loading