def are_passwords_matching(form) -> bool:
    """
    Checks whether password field and password confirm field have same value
    :param form: filled Django form instance
    :return: true if fields have same value, false otherwise
    """
    return form.cleaned_data['password'] == form.cleaned_data['password_confirm']