Migration pimp
This commit is contained in:
parent
a54ee18f74
commit
2ed0afcbba
14
adm/views.py
14
adm/views.py
|
|
@ -4,6 +4,7 @@ from django.shortcuts import render, redirect, reverse
|
|||
from django.urls import reverse_lazy
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponseRedirect,HttpResponse, JsonResponse
|
||||
from requests.api import head
|
||||
from .models import MainStatistic, MainSalesMonth
|
||||
from django.contrib.auth.models import User
|
||||
from chat.models import ChatMessage
|
||||
|
|
@ -733,13 +734,12 @@ class AdmImportFlow(TemplateView):
|
|||
Erstellt einen Gruppenordner
|
||||
'''
|
||||
def createAgGroupFolder(request, agencypk):
|
||||
print("HI!")
|
||||
#agency = Agency.objects.get(pk=agencypk)
|
||||
#data = {
|
||||
# "gid" : "agencymaingroupid_" + str(agency.pk),
|
||||
# "aid" : str(agency.pk)
|
||||
#}
|
||||
agency = Agency.objects.get(pk=agencypk)
|
||||
data = {
|
||||
"gid" : "agencymaingroupid_" + str(agency.pk),
|
||||
"aid" : str(agency.pk),
|
||||
}
|
||||
|
||||
r = requests.get(settings.NEXTCLOUD_URL + "apps/agency/createagf", auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
r = requests.post(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/da_agency/api/v1/creategf", auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API), data=data)
|
||||
print(r.text)
|
||||
return JsonResponse({'status' : True, 'message': 'Gruppenordner angelegt!'})
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ def NCAddGroupFolder(request):
|
|||
"sk'" : settings.NC_SECRETKEY
|
||||
}
|
||||
headers = {
|
||||
'Authorization': 'Bearer ' + request.COOKIES['nc_session_id']
|
||||
'Authorization': 'Bearer ' + request.user.profile.nc_sid
|
||||
}
|
||||
r = requests.post(settings.NEXTCLOUD_URL + "apps/agency/createagf", data=data, headers=headers)
|
||||
print(r.text)
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue