{% comment %} Overrides django-oauth-toolkit's default consent screen. Template resolution is by INSTALLED_APPS order, so `terno_dbi.oauth` must appear *before* `oauth2_provider` or DOT's own template wins and this file is silently ignored. Three things this says that the default does not: 1. **Which organisation** the grant is for. A user in more than one has no way to choose (BACKLOG D17), so at minimum they should see which one they are about to connect. 2. **Read versus write**, separated. "Change table descriptions" and "run queries" should not read as one undifferentiated list. 3. **When write will be withheld.** A non-admin's write scopes are stripped at mint time regardless of what they click. Saying so here is more honest than letting them approve something that will not happen. {% endcomment %} {% load i18n %} {% trans "Authorize" %} {{ application.name }} — Terno
{% if not error %}

Connect {{ application.name|default:"this application" }} to Terno?

It will be able to act on your behalf using the access below.

{% csrf_token %} {% for field in form %}{% if field.is_hidden %}{{ field }}{% endif %}{% endfor %} {% if organisation_choices %} {# More than one membership: let the user choose. Each organisation has its own databases and its own permissions, so this is a real decision and not a formality. #}

Each organisation has its own databases. To use another one later, add Terno a second time and pick it there.

{% elif organisation %}
Organisation
{{ organisation }}
{% endif %} {% if read_scopes %}

{% trans "Read access" %}

{% endif %} {% if write_scopes %}

{% trans "Write access" %}

{% endif %} {% if write_scopes and not user_can_write %}

Write access was requested, but you are not an administrator of {{ organisation|default:"this organisation" }}. If you continue, the connection will be read-only. An administrator can grant write access in Terno.

{% endif %} {% if form.errors or form.non_field_errors %}
{{ form.errors }}{{ form.non_field_errors }}
{% endif %}

You can disconnect at any time from your Terno account settings.

{% else %}

{% trans "Something went wrong" %}

{{ error.error }}

{{ error.description }}

{% endif %}