Move the files that were just attached to a new comment to their
    final location.

    :param attached_files: the mappings of desired filename to attach
                           and path where to find the original file
    :type attached_files: dict {filename, filepath}
    :param recID: the record ID to which we attach the files
    :param comid: the comment ID to which we attach the files

def move_attached_files_to_storage(attached_files, recID, comid):
    """
    Move the files that were just attached to a new comment to their
    final location.

    :param attached_files: the mappings of desired filename to attach
                           and path where to find the original file
    :type attached_files: dict {filename, filepath}
    :param recID: the record ID to which we attach the files
    :param comid: the comment ID to which we attach the files
    """
    for filename, filepath in iteritems(attached_files):
        dest_dir = os.path.join(CFG_COMMENTSDIR, str(recID), str(comid))
        try:
            os.makedirs(dest_dir)
        except:
            # Dir most probably already existed
            pass
        shutil.move(filepath,
                    os.path.join(dest_dir, filename))