Upload verbessert
This commit is contained in:
parent
2623b2db4d
commit
932b7baf4b
|
|
@ -1182,6 +1182,7 @@ function replaceFileDirectChoice(filetodo, choice){
|
|||
doUploadAction(filetodo_ex, choice);
|
||||
}
|
||||
|
||||
|
||||
function uploadAction(filetodo){
|
||||
|
||||
filetodo_ex = filetodo;
|
||||
|
|
@ -1189,7 +1190,7 @@ function uploadAction(filetodo){
|
|||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: "{% url 'cloud-adddir' parentid %}",
|
||||
url: "{% url 'cloud-adddir' 0 %}",
|
||||
data:{
|
||||
action : "check_doublefile",
|
||||
name : filetodo.name
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ def StandardAdd(request, id=False):
|
|||
'agencygroups' : AgencyGroup.objects.filter(agency=request.user.profile.agency),
|
||||
'usersofagency' : User.objects.filter(profile__agency=request.user.profile.agency),
|
||||
'files' : possibleFilesByVisible,
|
||||
'parentid' : list(DataDir.objects.filter(agency=request.user.profile.agency, is_root=True))[0].pk,
|
||||
#'parentid' : list(DataDir.objects.filter(agency=request.user.profile.agency, is_root=True))[0].pk,
|
||||
'standards' : Standards.objects.filter(agency=request.user.profile.agency, public=True),
|
||||
'quicklinks' : QuickLinks.objects.filter(agency=request.user.profile.agency),
|
||||
'contacts' : AGContacts.objects.filter(agency=request.user.profile.agency),
|
||||
|
|
@ -728,7 +728,8 @@ def StandardAdd(request, id=False):
|
|||
'possible_contacts' : possible_contacts,
|
||||
'agencynetworks' : agencynetworks,
|
||||
'agencygroups' : AgencyGroup.objects.filter(agency=request.user.profile.agency),
|
||||
'parentid' : list(DataDir.objects.filter(agency=request.user.profile.agency, is_root=True))[0].pk,
|
||||
#'parentid' : list(DataDir.objects.filter(agency=request.user.profile.agency, is_root=True))[0].pk,
|
||||
'parentid' : 0,
|
||||
'active_link' : 'standards',
|
||||
'update' : True,
|
||||
'aggroups' : AgencyGroup.objects.filter(agency=request.user.profile.agency)
|
||||
|
|
@ -887,7 +888,7 @@ def CopyStandard(request, pk):
|
|||
|
||||
new_standard.save()
|
||||
|
||||
datadir_parentid = list(DataDir.objects.filter(is_defaultstandard=True, agency__pk=request.user.profile.agency.pk))[0]
|
||||
#datadir_parentid = list(DataDir.objects.filter(is_defaultstandard=True, agency__pk=request.user.profile.agency.pk))[0]
|
||||
for f in sc.addedfiles_nc.all():
|
||||
tempdatafile = NCFile(agency=request.user.profile.agency, nc_id=f.nc_id)
|
||||
tempdatafile.save()
|
||||
|
|
|
|||
|
|
@ -1,11 +1 @@
|
|||
<h3>{{error}}</h3>
|
||||
|
||||
<script>
|
||||
/*
|
||||
$(document).ready(function(){
|
||||
setTimeout(function(){
|
||||
var ele = $("ul").find(`[data-id='logout']`);
|
||||
ele[0]['children'][0].click();
|
||||
}, 5000);
|
||||
})*/
|
||||
</script>
|
||||
<h3>{{error}}</h3>
|
||||
|
|
@ -209,6 +209,15 @@ def ncLogin(request, uid):
|
|||
try:
|
||||
user = User.objects.get(username=uid)
|
||||
if(getNCLoggedUserBySession(user.profile.nc_sid) == uid):
|
||||
# Checking, if all necessary folders are created
|
||||
#r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/" + user.username + '/Agenturdaten/Standards Uploadbereich/', auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API))
|
||||
|
||||
headers = {
|
||||
'Authorization': 'Bearer ' + user.profile.nc_sid
|
||||
}
|
||||
# Groupfolder for Standards
|
||||
r = requests.request("MKCOL", settings.NEXTCLOUD_URL + "remote.php/dav/files/" + user.username + '/Agenturdaten/Standards Uploadbereich/', headers=headers)
|
||||
|
||||
login(request, user)
|
||||
return redirect('users-dashboard')
|
||||
return render(request, 'users/nclog.html',{'error' : "Die Agenturdaten wurden aktualisiert. Bitte melden Sie sich ab und wieder an. Sollten Sie diese Meldung weiterhin sehen, kontaktieren Sie den Support."})
|
||||
|
|
|
|||
Loading…
Reference in New Issue