def delete(self, content: Content): content.owner = self._user content.is_deleted = True # TODO - G.M - 12-03-2018 - Inspect possible label conflict problem # INFO - G.M - 12-03-2018 - Set label name to avoid trouble when # un-deleting file. content.label = '{label}-{action}-{date}'.format( label=content.label, action='deleted', date=current_date_for_filename()) content.revision_type = ActionDescription.DELETION
def undelete(self, content: Content): content.owner = self._user content.is_deleted = False content.revision_type = ActionDescription.UNDELETION