Commit b7f1b67c authored by sebastien letort's avatar sebastien letort
Browse files

Published status of version can now be updated.

I used @transaction atomic to make all the update in one access to the DB (so speed up). But there is no constraint for that.
parent ddf2cf17
......@@ -599,6 +599,21 @@ class WebappVersionList(UserAccessMixin, ListView):
return super().get_context_data(**kwargs)
def post(self, request, *args, **kwargs):" {} - {}".format(request.POST, kwargs))
for version_id,values in request.POST.items():
if 'csrfmiddlewaretoken' == version_id:
o_version = WebappVersion.objects.get(id=version_id)
o_version.published = values
messages.success(request, "Published status have been updated.\n")
return redirect('main:webapp_version_list', kwargs['docker_name'])
class WebappJson(UserAccessMixin, DetailView):
"""json variant of the application details
......@@ -10,6 +10,10 @@
<li class="breadcrumb-item active" aria-current="page">versions</li>
{% endblock %}
{% block messages %}
{{ block.super }}
{% endblock %}
{% block content %}
<div class="container">
<div class="allgo-page">
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment