When a user is deleted from the database, their messages get deleted. This means that it is possible for the Message.previous_message property to refer to a deleted message, which will cause errors. Therefore, we should set this property to None if the message it refers to is about to be deleted. Look into overriding the delete method for the Message class.
When a user is deleted from the database, their messages get deleted. This means that it is possible for the Message.previous_message property to refer to a deleted message, which will cause errors. Therefore, we should set this property to None if the message it refers to is about to be deleted. Look into overriding the delete method for the Message class.