Skip to content

Commit 77bdf2a

Browse files
committed
chore: update .gitignore for agent files, clean up whitespace in Python files, and adjust API function formatting for better readability
1 parent 3da16a4 commit 77bdf2a

File tree

11 files changed

+139
-79
lines changed

11 files changed

+139
-79
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ backend/app.log
1616
tests/.env
1717
tests/cypress/screenshots/
1818

19-
.cursor
19+
# Agents
20+
.cursor
21+
.factory
22+
.kilocode
23+
.claude
24+
.agents
25+
.agent

backend/api/views/download.py

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -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

475475
def 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

537549
def 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

562574
def 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

587599
def 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 = [

backend/api/views/main.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
from api.utils.require_auth import all_users, mentee_only, verify_user
5252
from firebase_admin import auth as firebase_admin_auth
5353

54-
5554
main = Blueprint("main", __name__) # initialize blueprint
5655

5756

@@ -125,9 +124,9 @@ def get_accounts(account_type):
125124
if partner_account.assign_mentees:
126125
for mentee_item in partner_account.assign_mentees:
127126
if "id" in mentee_item:
128-
partners_by_assign_mentee[
129-
str(mentee_item["id"])
130-
] = partner_account
127+
partners_by_assign_mentee[str(mentee_item["id"])] = (
128+
partner_account
129+
)
131130
for account in mentees_data:
132131
if str(account.id) in partners_by_assign_mentee:
133132
pair_partner = partners_by_assign_mentee[str(account.id)]
@@ -156,10 +155,10 @@ def get_accounts(account_type):
156155
"email": hub_user.email,
157156
"image": hub_user.image,
158157
}
159-
158+
160159
# Check if we should include Hub accounts in Partners view
161160
include_hubs = request.args.get("include_hubs", "false").lower() == "true"
162-
161+
163162
if "restricted" in request.args:
164163
if request.args["restricted"] == "true":
165164
if "hub_user_id" in request.args:
@@ -192,7 +191,9 @@ def get_accounts(account_type):
192191
else:
193192
# Filter by include_hubs parameter
194193
if include_hubs:
195-
accounts = PartnerProfile.objects.filter(restricted__ne=True)
194+
accounts = PartnerProfile.objects.filter(
195+
restricted__ne=True
196+
)
196197
else:
197198
accounts = PartnerProfile.objects.filter(
198199
restricted__ne=True, hub_id=None

backend/api/views/meeting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from api.utils.jaas_jwt_builder import JaaSJwtBuilder
1111

12-
1312
meeting = Blueprint("meeting", __name__)
1413

1514
API_KEY = os.environ.get("EIGHT_X_EIGHT_API_KEY")

backend/api/views/messages.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from mongoengine.queryset.visitor import Q
2727
from urllib.parse import unquote
2828

29-
3029
messages = Blueprint("messages", __name__)
3130

3231

backend/api/views/training.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import pytz
4040
from mongoengine.queryset.visitor import Q
4141

42-
4342
training = Blueprint("training", __name__) # initialize blueprint
4443

4544

backend/manage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from api import create_app, socketio
55
from flask import request
66

7-
87
# sets up the app
98
app = create_app()
109

backend/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/components/AdminDropdowns.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ export function SortByApptDropdown(props) {
3939

4040
return (
4141
<Dropdown overlay={overlay} className={props.className} trigger={["click"]}>
42-
<Button style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
42+
<Button style={{ display: "flex", alignItems: "center", gap: 8 }}>
4343
<SortAscendingOutlined />
44-
<span style={{ fontWeight: 500 }}>{option ? option.text : "Sort by"}</span>
44+
<span style={{ fontWeight: 500 }}>
45+
{option ? option.text : "Sort by"}
46+
</span>
4547
<DownOutlined style={{ fontSize: 12 }} />
4648
</Button>
4749
</Dropdown>
@@ -115,7 +117,7 @@ export function MenteeMentorDropdown(props) {
115117
);
116118
return (
117119
<Dropdown overlay={overlay} className={props.className} trigger={["click"]}>
118-
<Button style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
120+
<Button style={{ display: "flex", alignItems: "center", gap: 8 }}>
119121
<span style={{ fontWeight: 500 }}>{option.text}</span>
120122
<DownOutlined style={{ fontSize: 12 }} />
121123
</Button>
@@ -249,7 +251,7 @@ export function HubsDropdown(props) {
249251
{props.options &&
250252
props.options.map((element, i) => {
251253
return (
252-
<Menu.Item
254+
<Menu.Item
253255
key={element.value}
254256
onClick={() => handleClick(element.value, element.label)}
255257
>
@@ -269,7 +271,9 @@ export function HubsDropdown(props) {
269271
trigger={["click"]}
270272
overlayStyle={{ overflowY: "auto", maxHeight: 300 }}
271273
>
272-
<Button style={{ display: 'flex', alignItems: 'center', gap: 8, minWidth: 140 }}>
274+
<Button
275+
style={{ display: "flex", alignItems: "center", gap: 8, minWidth: 140 }}
276+
>
273277
<span style={{ fontWeight: 500 }}>{option}</span>
274278
<DownOutlined style={{ fontSize: 12 }} />
275279
</Button>

0 commit comments

Comments
 (0)