diff --git a/standards/templates/standards/standards_add.html b/standards/templates/standards/standards_add.html
index 35babec..29af36d 100644
--- a/standards/templates/standards/standards_add.html
+++ b/standards/templates/standards/standards_add.html
@@ -145,10 +145,7 @@
diff --git a/standards/views.py b/standards/views.py
index 8dd7100..b712bbe 100644
--- a/standards/views.py
+++ b/standards/views.py
@@ -603,27 +603,39 @@ def StandardAdd(request, id=False):
#filesearchdata = 'infinity'
r = requests.request("SEARCH", settings.NEXTCLOUD_URL + "remote.php/dav/", data=filesearchdata, headers={'Content-Type' : 'text/xml', 'Authorization' : "Bearer " + request.user.profile.nc_sid})
# IDs filtern aus XML-Response
- try:
- split_response = r.text.split("")
-
- # Header des XML-Response entfernen
- split_response.pop(0)
-
- # IDs from the User
- for ele in split_response:
- new_id = ele.split("")[0]
-
- file_free = True
- # Prüfen, dass diese IDs nicht im aktuellen Standard sind
- for sf in standard.addedfiles_nc.all():
- if str(sf.nc_id) == str(new_id):
- file_free = False
-
- if file_free == True:
- possibleFilesByVisible.append(new_id)
- except:
- pass
+
+
+
+ ncfileids = [str(s) for s in re.findall('(.+?)', r.text)]
+ final_nc_files = []
+ # IDs from the User
+ for ele in ncfileids:
+ nc_filename_with_path = [str(s) for s in re.findall('(.+?)', ele)][0]
+ nc_filename_with_path = nc_filename_with_path.split("/")
+
+ filename = nc_filename_with_path[len(nc_filename_with_path)-1]
+
+ nc_file_id = [str(s) for s in re.findall('(.+?)', ele)][0]
+
+ if(len(filename) > 0):
+ final_nc_files.append([nc_file_id, filename])
+
+
+
+ # IDs from the User
+ for ele in final_nc_files:
+
+ file_free = True
+ # Prüfen, dass diese IDs nicht im aktuellen Standard sind
+ for sf in standard.addedfiles_nc.all():
+ if str(sf.nc_id) == str(ele[0]):
+ file_free = False
+
+ if file_free == True:
+ possibleFilesByVisible.append([ele[0], ele[1]])
+
+
# STANDARDS
possible_standards = []