Skip to content

Commit 2fb2b53

Browse files
committed
Minimal clean-up of deprecated features
1 parent 5194c61 commit 2fb2b53

22 files changed

Lines changed: 79 additions & 599 deletions

functions/Actions/CampsEvents.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,30 @@ def _generate_event_body(self, camp_info):
4141
'sendUpdates': 'all'
4242
}
4343

44-
def _manage_picture_folders(self, camp_info):
45-
"""Creates Google Drive folders for camp pictures if they don't exist."""
46-
# ... unchanged ...
47-
# (same as original)
48-
# Create holiday-specific folder if needed
49-
if not camp_info.get("picture_grand_parent_id"):
50-
folder_id = self.google.create_camp_pictures_folder(f"{camp_info.get('holiday_name')}")
51-
self.sf.sf.Picklist__c.update(camp_info["holiday_id"], {"Google_Drive_Pictures_ID__c": folder_id})
52-
camp_info["picture_grand_parent_id"] = folder_id
53-
54-
# Create week-specific folder if needed
55-
if not camp_info.get("picture_parent_id"):
56-
folder_id = self.google.create_camp_pictures_folder(
57-
f"{camp_info.get('picture_parent_name')}", parent=camp_info["picture_grand_parent_id"]
58-
)
59-
self.sf.sf.Picklist__c.update(camp_info["week_id"], {"Google_Drive_Pictures_ID__c": folder_id})
60-
camp_info["picture_parent_id"] = folder_id
61-
62-
# Create camp-specific folder if needed
63-
if not camp_info.get("pictures_id"):
64-
folder_id = self.google.create_camp_pictures_folder(
65-
f"{camp_info.get('pictures_name')}", parent=camp_info["picture_parent_id"]
66-
)
67-
self.sf.sf.Opportunity.update(camp_info["id"], {"Google_Drive_Pictures__c": folder_id})
44+
# def _manage_picture_folders(self, camp_info):
45+
# """Creates Google Drive folders for camp pictures if they don't exist."""
46+
# # ... unchanged ...
47+
# # (same as original)
48+
# # Create holiday-specific folder if needed
49+
# if not camp_info.get("picture_grand_parent_id"):
50+
# folder_id = self.google.create_camp_pictures_folder(f"{camp_info.get('holiday_name')}")
51+
# self.sf.sf.Picklist__c.update(camp_info["holiday_id"], {"Google_Drive_Pictures_ID__c": folder_id})
52+
# camp_info["picture_grand_parent_id"] = folder_id
53+
#
54+
# # Create week-specific folder if needed
55+
# if not camp_info.get("picture_parent_id"):
56+
# folder_id = self.google.create_camp_pictures_folder(
57+
# f"{camp_info.get('picture_parent_name')}", parent=camp_info["picture_grand_parent_id"]
58+
# )
59+
# self.sf.sf.Picklist__c.update(camp_info["week_id"], {"Google_Drive_Pictures_ID__c": folder_id})
60+
# camp_info["picture_parent_id"] = folder_id
61+
#
62+
# # Create camp-specific folder if needed
63+
# if not camp_info.get("pictures_id"):
64+
# folder_id = self.google.create_camp_pictures_folder(
65+
# f"{camp_info.get('pictures_name')}", parent=camp_info["picture_parent_id"]
66+
# )
67+
# self.sf.sf.Opportunity.update(camp_info["id"], {"Google_Drive_Pictures__c": folder_id})
6868

6969
def _add_camp_event_to_batch(self, camp_info):
7070
"""Handles creating or updating a single camp event via batch request."""
@@ -192,7 +192,7 @@ def process_camps(self, camps):
192192
for camp_info in camps:
193193
try:
194194
self._add_camp_event_to_batch(camp_info)
195-
self._manage_picture_folders(camp_info)
195+
# self._manage_picture_folders(camp_info)
196196
print(f'[INFO] Queued tasks for {camp_info.get("code")}')
197197
except Exception as e:
198198
print(f'[ERROR] Failed to queue tasks for {camp_info.get("code")}: {e}')

functions/Actions/CampsEvents2.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,23 @@ def callback3(request_id, response, exception):
102102
# Update the Google Event
103103
batch1.add(google.calendar.events().update(calendarId=google.CALENDAR_CAMPS_ID, eventId=camp_info.get("event_id"), body=event, sendUpdates="all"), callback=callback1)
104104

105-
def __camp_pictures(google, sf, camp_info):
106-
# If holiday specific folder does not exist, create it
107-
if camp_info.get("picture_grand_parent_id") == None:
108-
created_folder_id = google.create_camp_pictures_folder(f"{camp_info.get('holiday_name')}")
109-
sf.sf.Picklist__c.update(camp_info["holiday_id"], {"Google_Drive_Pictures_ID__c": created_folder_id})
110-
camp_info["picture_grand_parent_id"] = created_folder_id
111-
112-
# If week specific folder does not exist, create it
113-
if camp_info.get("picture_parent_id") == None:
114-
created_folder_id = google.create_camp_pictures_folder(f"{camp_info.get('picture_parent_name')}", parent=camp_info["picture_grand_parent_id"])
115-
sf.sf.Picklist__c.update(camp_info["week_id"], {"Google_Drive_Pictures_ID__c": created_folder_id})
116-
camp_info["picture_parent_id"] = created_folder_id
117-
118-
# If camp specific folder does not exist, create it
119-
if camp_info["pictures_id"] == None:
120-
created_folder_id = google.create_camp_pictures_folder(f"{camp_info.get('pictures_name')}", parent=camp_info["picture_parent_id"])
121-
sf.sf.Opportunity.update(camp_info["id"], {"Google_Drive_Pictures__c": created_folder_id})
105+
# def __camp_pictures(google, sf, camp_info):
106+
# # If holiday specific folder does not exist, create it
107+
# if camp_info.get("picture_grand_parent_id") == None:
108+
# created_folder_id = google.create_camp_pictures_folder(f"{camp_info.get('holiday_name')}")
109+
# sf.sf.Picklist__c.update(camp_info["holiday_id"], {"Google_Drive_Pictures_ID__c": created_folder_id})
110+
# camp_info["picture_grand_parent_id"] = created_folder_id
111+
#
112+
# # If week specific folder does not exist, create it
113+
# if camp_info.get("picture_parent_id") == None:
114+
# created_folder_id = google.create_camp_pictures_folder(f"{camp_info.get('picture_parent_name')}", parent=camp_info["picture_grand_parent_id"])
115+
# sf.sf.Picklist__c.update(camp_info["week_id"], {"Google_Drive_Pictures_ID__c": created_folder_id})
116+
# camp_info["picture_parent_id"] = created_folder_id
117+
#
118+
# # If camp specific folder does not exist, create it
119+
# if camp_info["pictures_id"] == None:
120+
# created_folder_id = google.create_camp_pictures_folder(f"{camp_info.get('pictures_name')}", parent=camp_info["picture_parent_id"])
121+
# sf.sf.Opportunity.update(camp_info["id"], {"Google_Drive_Pictures__c": created_folder_id})
122122

123123
def update_and_create_camps_per_week(google, sf, week_codes):
124124
# Get the camp details for the specified weeks
@@ -136,7 +136,7 @@ def update_and_create_camps_per_week(google, sf, week_codes):
136136
for camp_info in camps:
137137
try:
138138
__camp_event(google, sf, camp_info, batch1, batch2, batch3)
139-
__camp_pictures(google, sf, camp_info)
139+
# __camp_pictures(google, sf, camp_info)
140140
print(f'[SUCCESS] Event created for {camp_info.get("code")}')
141141
except Exception as e:
142142
raise ValueError(f'[ERROR] {e}')
@@ -165,7 +165,7 @@ def update_and_create_camps(google, sf, camp_id):
165165
for camp_info in camps:
166166
try:
167167
__camp_event(google, sf, camp_info, batch1, batch2, batch3)
168-
__camp_pictures(google, sf, camp_info)
168+
# __camp_pictures(google, sf, camp_info)
169169
print(f'[SUCCESS] Event created for {camp_info.get("code")}')
170170
except Exception as e:
171171
raise ValueError(f'[ERROR] {e}')

functions/Actions/UpdatePaymentsSheet.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

functions/Actions/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
from .EventsToText import generate_confirmation_text, get_teacher_dict
22
from .CampsForm import get_camps_form
3-
from .UpdatePaymentsSheet import update_payment_sheet
43
from .CampsEvents import update_and_create_camps_per_week
54
from .CampsEvents import update_and_create_camps
6-
# from .ClassesEvents import update_and_create_classes_per_week

functions/Functions [Deprecated]/AdminCreateCampsForm.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

functions/Functions [Deprecated]/AdminCreateTeacherAttestations.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

functions/Functions [Deprecated]/AdminCreateTeacherConvention.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

functions/Functions [Deprecated]/AdminGetTeachersPartners.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

functions/Functions [Deprecated]/AdminGetWeekCodes.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)