Skip to content

Commit

Permalink
Merge branch 'master' into event_report
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavberi committed Dec 19, 2024
2 parents dea96b3 + 819714b commit ddd3277
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions mutations/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def createEvent(details: InputEventDetails, info: Info) -> EventType:
raise Exception("Club does not exist.")

event_instance = Event(
name=details.name,
name=details.name.strip(),
clubid=details.clubid,
datetimeperiod=tuple(details.datetimeperiod),
poc=details.poc,
Expand All @@ -90,7 +90,7 @@ def createEvent(details: InputEventDetails, info: Info) -> EventType:
Event_Location(loc) for loc in details.location
]
if details.description is not None:
event_instance.description = details.description
event_instance.description = details.description.strip()
if details.poster is not None:
event_instance.poster = details.poster
if details.audience is not None:
Expand Down Expand Up @@ -143,8 +143,9 @@ def createEvent(details: InputEventDetails, info: Info) -> EventType:
details.clubid, details.datetimeperiod[0]
)

# TODO: Rather than storing if it is a student body event, just store the category itself
# Set studentBodyEvent to True if the event is a student body event
event_instance.studentBodyEvent = club_details["studentBody"]
event_instance.studentBodyEvent = club_details["category"] == "body"

created_id = eventsdb.insert_one(
jsonable_encoder(event_instance)
Expand Down Expand Up @@ -208,7 +209,7 @@ def editEvent(details: InputEditEventDetails, info: Info) -> EventType:
)

if details.name is not None and updatable:
updates["name"] = details.name
updates["name"] = details.name.strip()
if details.datetimeperiod is not None and updatable:
updates["datetimeperiod"] = details.datetimeperiod
if details.mode is not None and updatable:
Expand All @@ -226,7 +227,7 @@ def editEvent(details: InputEditEventDetails, info: Info) -> EventType:
):
raise Exception("Member Details for POC does not exist")
if details.description is not None:
updates["description"] = details.description
updates["description"] = details.description.strip()
if details.audience is not None:
updates["audience"] = [Audience(aud) for aud in details.audience]
if details.link is not None:
Expand Down
1 change: 0 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def getClubDetails(
cid
name
email
studentBody
category
}
}
Expand Down

0 comments on commit ddd3277

Please sign in to comment.