feat: add reschedule appointment method to AppointmentRequest model
This commit is contained in:
parent
f73fc31a0e
commit
e0a5a5a8f1
@ -651,6 +651,18 @@ class AppointmentRequest(models.Model):
|
|||||||
if commit:
|
if commit:
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
def reschedule_appointment(self, new_datetime, new_duration, commit=True):
|
||||||
|
self.status = 'scheduled'
|
||||||
|
self.scheduled_datetime = new_datetime
|
||||||
|
self.scheduled_duration = new_duration
|
||||||
|
self.rejection_reason = ''
|
||||||
|
|
||||||
|
if self.has_jitsi_meeting:
|
||||||
|
self.create_jitsi_meeting(with_moderation=True)
|
||||||
|
|
||||||
|
if commit:
|
||||||
|
self.save()
|
||||||
|
|
||||||
def reject_appointment(self, reason='', commit=True):
|
def reject_appointment(self, reason='', commit=True):
|
||||||
self.status = 'rejected'
|
self.status = 'rejected'
|
||||||
self.rejection_reason = reason
|
self.rejection_reason = reason
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user