Applying template with on demand restricting will enabled on demand restricting setting

Closes #1727