From 148bb6de9ee5baeaecc7f74a941a1c8f6e24216a Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Sat, 19 Dec 2020 00:09:56 +0100 Subject: [PATCH] Kalender kann nun abonniert werden mit Authentifikation --- api/urls.py | 2 +- api/views.py | 4 ++ cloud/templates/cloud/cloud_main.html | 2 +- cloud/views.py | 2 +- dasettings/views.py | 8 ++-- .../__pycache__/settings.cpython-38.pyc | Bin 4729 -> 4729 bytes .../__pycache__/urls.cpython-38.pyc | Bin 3172 -> 3179 bytes digitaleagentur/settings.py | 5 +- digitaleagentur/urls.py | 1 + .../__pycache__/counter_tag.cpython-38.pyc | Bin 20244 -> 20409 bytes standards/templatetags/counter_tag.py | 4 +- .../timemanagement/rendered_table.html | 1 + .../timemanagement/tm_ab_management.html | 39 +++++++++++++++ users/templates/users/base.html | 2 +- users/urls.py | 3 +- users/views.py | 45 ++++++++++++++++-- 16 files changed, 103 insertions(+), 15 deletions(-) diff --git a/api/urls.py b/api/urls.py index 987d2ed..0bcf797 100644 --- a/api/urls.py +++ b/api/urls.py @@ -11,4 +11,4 @@ urlpatterns = [ path('getchatrooms/', views.getchatrooms, name='api-getchatrooms'), path('getsinglechat/', views.getsinglechat, name='api-getsinglechat'), path('chatnewmessage/', views.savenewchatmessage, name='api-savechatmessage'), -] \ No newline at end of file +] diff --git a/api/views.py b/api/views.py index d20dbdd..a7037f8 100644 --- a/api/views.py +++ b/api/views.py @@ -10,6 +10,9 @@ from rest_framework import status from rest_framework.authentication import SessionAuthentication, BasicAuthentication, TokenAuthentication from rest_framework.decorators import authentication_classes from chat.models import ChatRoom, ChatMessage +from django.http import HttpResponseRedirect,HttpResponse, JsonResponse + +from timemanagement.models import Absence class GetUserId(APIView): permission_classes = (IsAuthenticated,) # <-- And here @@ -17,6 +20,7 @@ class GetUserId(APIView): def post(self, request): return Response({"userid" : self.request.user.pk}) + @api_view(['POST', ]) @permission_classes((IsAuthenticated,)) def getStandardList(request): diff --git a/cloud/templates/cloud/cloud_main.html b/cloud/templates/cloud/cloud_main.html index a9b0e22..24cd791 100644 --- a/cloud/templates/cloud/cloud_main.html +++ b/cloud/templates/cloud/cloud_main.html @@ -794,7 +794,7 @@ $('.droppable_div').on('dragleave', function (e) { }); //allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, text/plain, application/pdf, image/*, image/x-png, image/gif, image/jpg, image/jpeg, image/JPEG, image/JPG, docx, JPEG, JPG, doc, odt, ODT, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -allowedtypes = ['doc','docx','odt','ods','xls','xlsx','xlsm','ppt','pptx','mov','avi','svg','png','jpg','jpeg','mp3', 'wav', 'zip', 'rar', 'mp4', 'mwv', 'flv', 'eps', 'txt', 'pdf', "pages", "numbers"] +allowedtypes = ['doc','docx','odt','ods','xls','xlsx','xlsm','ppt','pptx','mov','avi','svg','png','jpg','jpeg','mp3', 'wav', 'zip', 'rar', 'mp4', 'mwv', 'flv', 'eps', 'txt', 'pdf', "pages", "numbers", "ics"] function getFileExtension1(filename) { diff --git a/cloud/views.py b/cloud/views.py index 4a78263..d7f30d8 100644 --- a/cloud/views.py +++ b/cloud/views.py @@ -251,7 +251,7 @@ def adddirbyajax(request, parent): # VALIDATE FILE-TYPE file_ext_arr = request.FILES['uploadedfile'].name.split(".") file_ext = file_ext_arr[len(file_ext_arr)-1] - allowed_types = ["txt", "TXT", "png", "PNG", "jpeg", "JPEG", "jpg", "JPG", "PDF", "pdf", "csv", "CSV", "DOC", "doc", "DOCX", "docx", "ODT", "odt", "PPT", "ppt", "PPTX", "pptx", "XLS", "xls", "XLSX", "xlsx", "mov", "MOV", "SVG", "svg", "ZIP", "zip", "RAR", "rar", "EPS", "eps", "MP3", "mp3", "WAV", "wav", "avi", "AVI", "FLV", "flv", "MP4", "mp4", "PAGES", "pages", "NUMBERS", "numbers"] + allowed_types = ["txt", "TXT", "png", "PNG", "jpeg", "JPEG", "jpg", "JPG", "PDF", "pdf", "csv", "CSV", "DOC", "doc", "DOCX", "docx", "ODT", "odt", "PPT", "ppt", "PPTX", "pptx", "XLS", "xls", "XLSX", "xlsx", "mov", "MOV", "SVG", "svg", "ZIP", "zip", "RAR", "rar", "EPS", "eps", "MP3", "mp3", "WAV", "wav", "avi", "AVI", "FLV", "flv", "MP4", "mp4", "PAGES", "pages", "NUMBERS", "numbers", "ics", "ICS"] file_ok = False for t in allowed_types: diff --git a/dasettings/views.py b/dasettings/views.py index 64802e8..ac50212 100644 --- a/dasettings/views.py +++ b/dasettings/views.py @@ -1741,10 +1741,10 @@ class BillPlanUpdate(UpdateView): "taxConditions": { "taxType": "net" }, - "paymentConditions": { - "paymentTermLabel": "Bitte zahlen Sie innerhalb von 14 Tagen.", - "paymentTermDuration": 14, - }, + #"paymentConditions": {da + # "paymentTermLabel": "Bitte zahlen Sie innerhalb von 14 Tagen.", + # "paymentTermDuration": 14, + #}, "shippingConditions": { #"shippingDate": voucher_date_today + "T00:00:00.000+00:00", "shippingType": "none" diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index b25f3672f3c637eb7ca67fb572f28913335fa664..f6489ba8209c9e77287a18c78b8677c34e4cdbbf 100644 GIT binary patch delta 34 ocmeyV@>7L3l$V!_0SE&1@5aB{$a`9lQFHQ5L03kB$?`%`0Ja(m8~^|S delta 34 ocmeyV@>7L3l$V!_0SJ=$uf;#x$a`9lQGN1FL03lp$?`%`0JJa)00000 diff --git a/digitaleagentur/__pycache__/urls.cpython-38.pyc b/digitaleagentur/__pycache__/urls.cpython-38.pyc index 4758bd49a89e2fc79087c1f1a8442e7994ce5e90..61f466f3ade2a01956796e6a7d3f21a09138606d 100644 GIT binary patch delta 63 zcmaDN@mhj6l$V!_0SM;n-;JNVk#{Dyg13HXacWVqenv@AVs1gIzF%rZNpenpX^MV8 RQD#|U$>jaqiFxNacWVqenv@AVs1gIzDs^`X>Mv>N%7=k K+>4l*Sr`HI1QHMc diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py index bbfdfe0..c1de0ad 100644 --- a/digitaleagentur/settings.py +++ b/digitaleagentur/settings.py @@ -92,9 +92,11 @@ INSTALLED_APPS = [ 'channels', 'channels_presence', 'simple_history', - 'captcha' + 'captcha', ] + + MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -146,6 +148,7 @@ CHANNEL_LAYERS = { } + # Password validation # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators diff --git a/digitaleagentur/urls.py b/digitaleagentur/urls.py index 2b302c4..88ce86b 100644 --- a/digitaleagentur/urls.py +++ b/digitaleagentur/urls.py @@ -52,6 +52,7 @@ urlpatterns = [ if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + # ERROR HANDLERS handler404 = 'users.views.handler404' handler500 = 'users.views.handler500' \ No newline at end of file diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index d746e9aa8e8c3edb05544ed32e003fd85a314ccc..2d5a31104e00778b669a1e60e12e8f186262e9b1 100644 GIT binary patch delta 1031 zcmYk4e@s(X6vumR%fptGX(&*%h%|_F2oDelKiWczf^-xK1phE9tMsKQ*lKRemMxpn zY4(pX{y0nA5~Ii;CMHHho-x^9ncV+f20XZkid=Puh#&!er%Xi$g0JaYs)_e?DS53_C`n*#joeFZ!RB z0~J<72}P1)5ozGIs-h;t9FD{dOK2>a;oi8R1jb@xskC7o(DtXb#2!r=+1p0b`&g{# z-S^dhAsnyr!EOD1l?`ADe=9FWMUBBUCe<$G4z)w&CmZwdrdkFw`jUDClm{H0)xWQ; z2jwy8VS#OaC*G=?gs1wUO#uOK@JqJ??=)O3UFO`&1W%SB(os1_(y&S`5s4?Gnw0Z+ zsj&;*>&uN-p#E=8_A;I^CJ0=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cW9)3HgyG+~A?OPC|964bZcBo#ud>IspAC_*$Lh9j`u>yahD y>}$?rQnN?)bx2;RS@y6*sz@go2w4OpXks+XL^7M;Bvh+U*;yL_Im*RaGyDZuQ3xdf diff --git a/standards/templatetags/counter_tag.py b/standards/templatetags/counter_tag.py index 2f6e837..351d63a 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -904,7 +904,9 @@ def getAgencyBillStatus(agency): return returnvalue - +@register.simple_tag +def getBaseURLIcsLink(agency): + return settings.BASE_URL + "/ics/" + str(agency.pk) diff --git a/timemanagement/templates/timemanagement/rendered_table.html b/timemanagement/templates/timemanagement/rendered_table.html index 4341eb1..7a8b87c 100644 --- a/timemanagement/templates/timemanagement/rendered_table.html +++ b/timemanagement/templates/timemanagement/rendered_table.html @@ -225,6 +225,7 @@ + {% if user|usergperm:"absencemanager" %}