Skip to content

Commit 4bd30c1

Browse files
Add meeting join link and code to the end of all event.body
1 parent 60841ac commit 4bd30c1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

hackathon/forms.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,12 @@ class Meta:
252252

253253
def __init__(self, *args, **kwargs):
254254
super(EventForm, self).__init__(*args, **kwargs)
255+
256+
def save(self, commit=True):
257+
event = super(EventForm, self).save(commit=False)
258+
# Append f-string to the body field
259+
webinar_link = self.cleaned_data.get('webinar_link', '')
260+
event.body += f'<br><br><b>Meeting Join Link:</b> <a href="{webinar_link}" target="_blank">Click here to join</a><br><b>Meeting Join Code:</b> code'
261+
if commit:
262+
event.save()
263+
return event

0 commit comments

Comments
 (0)