Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

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): ...@@ -599,6 +599,21 @@ class WebappVersionList(UserAccessMixin, ListView):
return super().get_context_data(**kwargs) return super().get_context_data(**kwargs)
@transaction.atomic
def post(self, request, *args, **kwargs):
log.info("WebappVersionList.post {} - {}".format(request.POST, kwargs))
for version_id,values in request.POST.items():
if 'csrfmiddlewaretoken' == version_id:
continue
o_version = WebappVersion.objects.get(id=version_id)
o_version.published = values
o_version.save()
messages.success(request, "Published status have been updated.\n")
return redirect('main:webapp_version_list', kwargs['docker_name'])
class WebappJson(UserAccessMixin, DetailView): class WebappJson(UserAccessMixin, DetailView):
"""json variant of the application details """json variant of the application details
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<li class="breadcrumb-item active" aria-current="page">versions</li> <li class="breadcrumb-item active" aria-current="page">versions</li>
{% endblock %} {% endblock %}
{% block messages %}
{{ block.super }}
{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<div class="allgo-page"> <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