2222from ietf .secr .utils .decorators import check_permissions , sec_only
2323from ietf .secr .utils .document import get_full_path
2424from ietf .secr .utils .group import get_my_groups , groups_by_session
25- from ietf .secr .utils .meeting import get_upload_root , get_materials , get_timeslot , get_proceedings_path , get_proceedings_url
25+ from ietf .secr .utils .meeting import get_materials , get_timeslot , get_proceedings_path , get_proceedings_url
2626from ietf .doc .models import Document , DocAlias , DocEvent , State , NewRevisionDocEvent
2727from ietf .group .models import Group
2828from ietf .ietfauth .utils import has_role , role_required
@@ -68,9 +68,9 @@ def get_doc_filename(doc):
6868 session = doc .session_set .all ()[0 ]
6969 meeting = session .meeting
7070 if doc .external_url :
71- return os .path .join (get_upload_root ( meeting ),doc .type .slug ,doc .external_url )
71+ return os .path .join (meeting . get_materials_path ( ),doc .type .slug ,doc .external_url )
7272 else :
73- path = os .path .join (get_upload_root ( meeting ),doc .type .slug ,doc .name )
73+ path = os .path .join (meeting . get_materials_path ( ),doc .type .slug ,doc .name )
7474 files = glob .glob (path + '.*' )
7575 # TODO we might want to choose from among multiple files using some logic
7676 return files [0 ]
@@ -156,18 +156,18 @@ def get_next_order_num(session):
156156def handle_upload_file (file ,filename ,meeting ,subdir ):
157157 '''
158158 This function takes a file object, a filename and a meeting object and subdir as string.
159- It saves the file to the appropriate directory, get_upload_root () + subdir.
159+ It saves the file to the appropriate directory, get_materials_path () + subdir.
160160 If the file is a zip file, it creates a new directory in 'slides', which is the basename of the
161161 zip file and unzips the file in the new directory.
162162 '''
163163 base , extension = os .path .splitext (filename )
164164
165165 if extension == '.zip' :
166- path = os .path .join (get_upload_root ( meeting ),subdir ,base )
166+ path = os .path .join (meeting . get_materials_path ( ),subdir ,base )
167167 if not os .path .exists (path ):
168168 os .mkdir (path )
169169 else :
170- path = os .path .join (get_upload_root ( meeting ),subdir )
170+ path = os .path .join (meeting . get_materials_path ( ),subdir )
171171 if not os .path .exists (path ):
172172 os .makedirs (path )
173173
@@ -191,7 +191,7 @@ def make_directories(meeting):
191191 '''
192192 This function takes a meeting object and creates the appropriate materials directories
193193 '''
194- path = get_upload_root ( meeting )
194+ path = meeting . get_materials_path ( )
195195 os .umask (0 )
196196 for leaf in ('slides' ,'agenda' ,'minutes' ,'id' ,'rfc' ,'bluesheets' ):
197197 target = os .path .join (path ,leaf )
@@ -401,7 +401,7 @@ def delete_interim_meeting(request, meeting_num):
401401 group = sessions [0 ].group
402402
403403 # delete directories
404- path = get_upload_root ( meeting )
404+ path = meeting . get_materials_path ( )
405405
406406 # do a quick sanity check on this path before we go and delete it
407407 parts = path .split ('/' )
0 commit comments