Skip to content

Commit 340c854

Browse files
committed
The helper function make_directories() is now used in only one place, and the function where it's used isn't terribly long. Inlined it, and added a comment (and question) about the os.umask() call. The list of leaves is possibly out of sync with some other places where material doctypes are used.
- Legacy-Id: 11439
1 parent cc6096e commit 340c854

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

ietf/meeting/helpers.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -517,18 +517,6 @@ def get_next_agenda_name(meeting):
517517
sequence=str(last_sequence + 1).zfill(2))
518518

519519

520-
def make_directories(meeting):
521-
'''
522-
This function takes a meeting object and creates the appropriate materials directories
523-
'''
524-
path = meeting.get_materials_path()
525-
os.umask(0)
526-
for leaf in ('slides','agenda','minutes','id','rfc','bluesheets'):
527-
target = os.path.join(path,leaf)
528-
if not os.path.exists(target):
529-
os.makedirs(target)
530-
531-
532520
def send_interim_approval_request(meetings):
533521
"""Sends an email to the secretariat, group chairs, and resposnible area
534522
director or the IRTF chair noting that approval has been requested for a

ietf/secr/meetings/views.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from ietf.ietfauth.utils import role_required
1818
from ietf.utils.mail import send_mail
19-
from ietf.meeting.helpers import get_meeting, make_directories
19+
from ietf.meeting.helpers import get_meeting, make_materials_directories
2020
from ietf.meeting.models import Meeting, Session, Room, TimeSlot, SchedTimeSessAssignment, Schedule
2121
from ietf.group.models import Group, GroupEvent
2222
from ietf.person.models import Person
@@ -314,7 +314,18 @@ def add(request):
314314
meeting.save()
315315

316316
#Create Physical new meeting directory and subdirectories
317-
make_directories(meeting)
317+
path = meeting.get_materials_path()
318+
# Default umask is 0x022, meaning strip write premission for group and others.
319+
# Change this temporarily to 0x0, to keep write permission for group and others.
320+
# (WHY??) (Note: this code is old -- was present already when the secretariat code
321+
# was merged with the regular datatracker code; then in secr/proceedings/views.py
322+
# in make_directories())
323+
saved_umask = os.umask(0)
324+
for leaf in ('slides','agenda','minutes','id','rfc','bluesheets'):
325+
target = os.path.join(path,leaf)
326+
if not os.path.exists(target):
327+
os.makedirs(target)
328+
os.umask(saved_umask)
318329

319330
messages.success(request, 'The Meeting was created successfully!')
320331
return redirect('meetings')

0 commit comments

Comments
 (0)