From 9d8488a0fb4c6834223e8daa3dc384665b97f982 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 24 May 2021 12:58:19 +0300 Subject: Fix saving user --- servo/views/admin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'servo/views') diff --git a/servo/views/admin.py b/servo/views/admin.py index 9924f2b..5d1da4a 100644 --- a/servo/views/admin.py +++ b/servo/views/admin.py @@ -613,10 +613,9 @@ def edit_queue(request, pk=None): if form.is_valid(): try: queue = form.save() - queue.user_set = form.cleaned_data['users'] - queue.save() + queue.user_set.set(form.cleaned_data['users']) except Exception as e: - messages.error(request, _('Failed to save queue')) + messages.error(request, _('Failed to save queue (%s)' % e)) return render(request, 'admin/queues/form.html', locals()) formset = StatusFormSet(request.POST, instance=queue) -- cgit v1.2.3