def METHOD_NAME(obj, formdata):
    if formdata.get('type_of_doc') == 'chapter':
        if not formdata.get('parent_book'):
            result = list(check_book_existence(formdata.get('book_title')))
            if len(result) == 1:
                formdata['parent_book'] = result[0][0]
    return formdata