@@ -106,7 +106,7 @@ def download_accounts_info():
106106 elif account_type == Account .PARTNER :
107107 # Check if we should include Hub accounts in Partners view
108108 include_hubs = data .get ("include_hubs" , "false" ).lower () == "true"
109-
109+
110110 if hub_user_id is not None :
111111 accounts = PartnerProfile .objects .filter (
112112 firebase_uid__nin = admin_ids , hub_id = hub_user_id
@@ -152,7 +152,9 @@ def download_accounts_info():
152152 temp = []
153153 for account in accounts :
154154 if account .hub_id is not None :
155- account .hub_user_name = Hub_user_names_object .get (str (account .hub_id ), "" )
155+ account .hub_user_name = Hub_user_names_object .get (
156+ str (account .hub_id ), ""
157+ )
156158 hub_details = Hub_user_details_object .get (str (account .hub_id ))
157159 if hub_details :
158160 account .hub_email = hub_details .email
@@ -257,9 +259,7 @@ def download_mentor_apps(apps, partner_object):
257259 (
258260 partner_object [acct .partner ]
259261 if acct .partner and acct .partner in partner_object
260- else acct .organization
261- if acct .organization
262- else ""
262+ else acct .organization if acct .organization else ""
263263 ),
264264 ]
265265 )
@@ -436,7 +436,7 @@ def download_partner_accounts(accounts):
436436 "," .join (acct .regions ),
437437 acct .intro ,
438438 acct .website ,
439- acct .hub_user_name if hasattr (acct , ' hub_user_name' ) else "" ,
439+ acct .hub_user_name if hasattr (acct , " hub_user_name" ) else "" ,
440440 acct .linkedin ,
441441 acct .sdgs ,
442442 acct .topics ,
@@ -474,7 +474,7 @@ def download_partner_accounts(accounts):
474474
475475def download_hub_accounts (accounts ):
476476 """Download Hub accounts separately from Partners.
477-
477+
478478 Hubs are represented as PartnerProfile documents with a hub_id field.
479479 This function exports Hub-specific data.
480480 """
@@ -487,18 +487,30 @@ def download_hub_accounts(accounts):
487487 acct .organization ,
488488 acct .location ,
489489 acct .person_name ,
490- "," .join (acct .regions ) if hasattr (acct , 'regions' ) and acct .regions else "" ,
491- acct .intro if hasattr (acct , 'intro' ) else "" ,
490+ (
491+ "," .join (acct .regions )
492+ if hasattr (acct , "regions" ) and acct .regions
493+ else ""
494+ ),
495+ acct .intro if hasattr (acct , "intro" ) else "" ,
492496 acct .website ,
493- acct .hub_user_name if hasattr (acct , ' hub_user_name' ) else "" ,
494- acct .hub_email if hasattr (acct , ' hub_email' ) else "" ,
495- acct .hub_url if hasattr (acct , ' hub_url' ) else "" ,
496- acct .linkedin if hasattr (acct , ' linkedin' ) else "" ,
497- acct .sdgs if hasattr (acct , ' sdgs' ) else "" ,
498- acct .topics if hasattr (acct , ' topics' ) else "" ,
497+ acct .hub_user_name if hasattr (acct , " hub_user_name" ) else "" ,
498+ acct .hub_email if hasattr (acct , " hub_email" ) else "" ,
499+ acct .hub_url if hasattr (acct , " hub_url" ) else "" ,
500+ acct .linkedin if hasattr (acct , " linkedin" ) else "" ,
501+ acct .sdgs if hasattr (acct , " sdgs" ) else "" ,
502+ acct .topics if hasattr (acct , " topics" ) else "" ,
499503 acct .image .url if acct .image else "None" ,
500- len (acct .assign_mentors ) if hasattr (acct , 'assign_mentors' ) and acct .assign_mentors else 0 ,
501- len (acct .assign_mentees ) if hasattr (acct , 'assign_mentees' ) and acct .assign_mentees else 0 ,
504+ (
505+ len (acct .assign_mentors )
506+ if hasattr (acct , "assign_mentors" ) and acct .assign_mentors
507+ else 0
508+ ),
509+ (
510+ len (acct .assign_mentees )
511+ if hasattr (acct , "assign_mentees" ) and acct .assign_mentees
512+ else 0
513+ ),
502514 (
503515 int (acct .text_notifications )
504516 if acct .text_notifications != None
@@ -536,7 +548,7 @@ def download_hub_accounts(accounts):
536548
537549def download_guest_accounts (accounts ):
538550 """Download Guest accounts.
539-
551+
540552 Guests have basic information: firebase_uid, email, name, and roomName.
541553 """
542554 accts = []
@@ -547,7 +559,7 @@ def download_guest_accounts(accounts):
547559 acct .name ,
548560 acct .email ,
549561 acct .firebase_uid ,
550- acct .roomName if hasattr (acct , ' roomName' ) and acct .roomName else "" ,
562+ acct .roomName if hasattr (acct , " roomName" ) and acct .roomName else "" ,
551563 ]
552564 )
553565 columns = [
@@ -561,7 +573,7 @@ def download_guest_accounts(accounts):
561573
562574def download_support_accounts (accounts ):
563575 """Download Support accounts.
564-
576+
565577 Support accounts have basic information: firebase_uid, email, name, and roomName.
566578 """
567579 accts = []
@@ -572,7 +584,7 @@ def download_support_accounts(accounts):
572584 acct .name ,
573585 acct .email ,
574586 acct .firebase_uid ,
575- acct .roomName if hasattr (acct , ' roomName' ) and acct .roomName else "" ,
587+ acct .roomName if hasattr (acct , " roomName" ) and acct .roomName else "" ,
576588 ]
577589 )
578590 columns = [
@@ -586,7 +598,7 @@ def download_support_accounts(accounts):
586598
587599def download_moderator_accounts (accounts ):
588600 """Download Moderator accounts.
589-
601+
590602 Moderator accounts have basic information: firebase_uid, email, name, and roomName.
591603 """
592604 accts = []
@@ -597,7 +609,7 @@ def download_moderator_accounts(accounts):
597609 acct .name ,
598610 acct .email ,
599611 acct .firebase_uid ,
600- acct .roomName if hasattr (acct , ' roomName' ) and acct .roomName else "" ,
612+ acct .roomName if hasattr (acct , " roomName" ) and acct .roomName else "" ,
601613 ]
602614 )
603615 columns = [
0 commit comments