From 67d8e40595f8aa170df5b2ca53696cb4b65c19dd Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Mon, 16 Dec 2019 20:39:19 +0100 Subject: [PATCH] =?UTF-8?q?Bug=20bei=20Standard-Ansicht=20gel=C3=B6st=20Di?= =?UTF-8?q?rektes=20ver=C3=B6ffentlichen=20bei=20Standards=20geht=20jetzt,?= =?UTF-8?q?=20wird=20aber=20auf=20false=20gesetzt,=20sollte=20der=20User?= =?UTF-8?q?=20nicht=20=C3=BCber=20ausreichende=20Rechte=20verf=C3=BCgen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- standards/__pycache__/forms.cpython-38.pyc | Bin 3005 -> 3070 bytes standards/__pycache__/views.cpython-38.pyc | Bin 6189 -> 6345 bytes standards/forms.py | 7 ++++--- .../templates/standards/standards_add.html | 3 --- .../standards/standards_management.html | 13 +++++++++---- standards/views.py | 10 ++++++++-- users/templates/users/base.html | 2 +- 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/standards/__pycache__/forms.cpython-38.pyc b/standards/__pycache__/forms.cpython-38.pyc index c9429960e4b0e396dd3523e4e9220c272d0a0a34..9d26b79ee1af7dacd4c17856fd0f4d13c15891d1 100644 GIT binary patch delta 381 zcmdlh{!g4Yl$V!_0SFpzevggZ$Q#AT#RlX#0CBP2?s^6oGDx> z-07@QY$-g!44S-?7chpomr4MYx?~omW|t_Gr4}9DmX?;9SCW&NoROMmugQ9gB`+~I z^%hHFQEK8XmXgHc>|5-~`FSNkHMiIbN|S&Ji+F)1OcrL^AR+){a4@nkF)>2nZ#MSH zSDC(x^8qD__<_Vq##76TFtj6#eGK+FZyEdXY5FiyU} zlFukI*@1N@qrl{KTh~k2p_5?M<6}jmwNNX)-VOYF1St HZXtC5a57tS delta 230 zcmew-zE_+#l$V!_0SKOM`5vpXkvEEQvJATwqr~KmtiqFbGCDG?WSK0?)JRnV*XD1CT1uQWN9jGgFHACJVD%kW~N*7mEQ221X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&Q?CJ5-qC8R2rT0C$ZZob8(JD~Js*5(n)}(<)6+W1^2QU1``r(_Mrq zth%G(m$rKz-r#R{T_lg=k3^y*E {% csrf_token %} {{normalForm|crispy}} - -

Wenn ein Standard erstellt wurde, kann er nur von einer Person mit dem Recht Standards bearbeiten und freischalten veröffentlicht werden.


  @@ -37,5 +35,4 @@ $(document).ready(function() { }); }); - {% endblock content %} diff --git a/standards/templates/standards/standards_management.html b/standards/templates/standards/standards_management.html index 63251d8..e71f2af 100644 --- a/standards/templates/standards/standards_management.html +++ b/standards/templates/standards/standards_management.html @@ -101,12 +101,16 @@ @@ -116,6 +120,7 @@ {% endfor %} + diff --git a/standards/views.py b/standards/views.py index 60b239a..2d45238 100644 --- a/standards/views.py +++ b/standards/views.py @@ -53,10 +53,16 @@ def StandardAdd(request): new_standard.task = normalForm.cleaned_data['task'] new_standard.area = normalForm.cleaned_data['area'] new_standard.name = normalForm.cleaned_data['name'] - new_standard.content = editorForm.cleaned_data['content'] + new_standard.content = editorForm.cleaned_data['content'] + new_standard.public = normalForm.cleaned_data['public'] new_standard.save() tempstandardname = normalForm.cleaned_data['name'] - messages.success(request, f'Standard {tempstandardname} hinzugefügt! Dieser muss noch veröffentlicht werden.') + if(new_standard.public and request.user.has_perm('standard-management')): + messages.success(request, f'Standard {tempstandardname} hinzugefügt und veröffentlicht.') + else: + new_standard.public = False + new_standard.save() + messages.success(request, f'Standard {tempstandardname} hinzugefügt! Dieser muss noch veröffentlicht werden.') return redirect('standards') else: diff --git a/users/templates/users/base.html b/users/templates/users/base.html index b096159..4337eab 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -201,7 +201,7 @@