def update_status(self, institute, case, user, status, link):
if status not in CASE_STATUSES:<EOL><INDENT>LOG.warning("<STR_LIT>".format(status))<EOL>return None<EOL><DEDENT>LOG.info("<STR_LIT>".format(<EOL>case['<STR_LIT>'], status))<EOL>self.create_event(<EOL>institute=institute,<EOL>case=case,<EOL>user=user,<EOL>link=link,<EOL>category='<STR_LIT>',<EOL>verb='<STR_LIT:status>',<EOL>subject=case['<STR_LIT>']<EOL>)<EOL>LOG.info("<STR_LIT>".format(case['<STR_LIT>'], status))<EOL>updated_case = self.case_collection.find_one_and_update(<EOL>{'<STR_LIT>': case['<STR_LIT>']},<EOL>{'<STR_LIT>': {'<STR_LIT:status>': status}},<EOL>return_document=pymongo.ReturnDocument.AFTER<EOL>)<EOL>LOG.debug("<STR_LIT>")<EOL>return updated_case<EOL>
Update the status of a case.

        This function will create an Event to log that a user have updated the
        status of a case. Also the status of the case will be updated.
        Status could be anyone of:
            ("prioritized", "inactive", "active", "solved", "archived")

        Arguments:
            institute (dict): A Institute object
            case (dict): A Case object
            user (dict): A User object
            status (str): The new status of the case
            link (str): The url to be used in the event

        Returns:
            updated_case