first_boot: Fix various issues and refactor

- Fix major regression so that steps can submitted multiple times in
  case of errors.

- Don't serve the welcome page (and other pages) only once.  Show it
  until action is an taken.  This does not apply to the final step.

- Eliminate all coupling of one first boot step on another.

- Move first boot helper methods to __init__.py instead of middleware as
  it is more generic than middleware.

- Implement caching the first boot state to avoid an SQL query on every
  page load.  The down side is that if first boot state is modified in
  the backend DB outside Plinth, Plinth will need to be restarted to
  catch the modified value.

- Mark some methods as private.

- Refactor middleware code for slightly more simplicity.

- Don't show sidebar in pagekite first boot step.  Set width like other
  pages.
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2016-12-04 15:24:48 -05:00
1 parent 6cce89ed68
commit f457a0bdd3
9 files changed
+227 -157

No files matched your search

@@ -36,10 +36,14 @@
alt="{{ box_name }}" width="640"/>
</p>
<p class="text-center">
<a href="{% url next_url %}"
class="btn btn-primary btn-lg">{% trans "Start Setup" %}</a>
</p>
<form class="form text-center" method="post">
{% csrf_token %}
<p>
<input type="submit" class="btn btn-lg btn-primary"
value="{% trans "Start Setup" %}"/>
</p>
</form>
<p class="text-center" style="font-size: larger">
{% blocktrans trimmed %}