<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_portal_type(cursor, id, version):
 """Return the module's portal_type."""

    args = join_ident_hash(id, version)
    sql_statement = """
    SELECT m.portal_type
    FROM modules as m
    WHERE ident_hash(uuid, major_version, minor_version) = %s
    """

    cursor.execute(sql_statement, vars=(args,))
    res = cursor.fetchone()
    if res is None:
        return None
    else:
        return res[0]