Skip to content

Commit

Permalink
Strip description and name of event before saving in db
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavberi committed Dec 11, 2024
1 parent 7e64282 commit bb4d3b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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 @@ -208,7 +208,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 +226,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

0 comments on commit bb4d3b0

Please sign in to comment.