diff --git a/templates/identity/create.html b/templates/identity/create.html
index 9d8dd55..8d353d2 100644
--- a/templates/identity/create.html
+++ b/templates/identity/create.html
@@ -3,23 +3,38 @@
{% block title %}Create Identity{% endblock %}
{% block content %}
-
+ {% if no_valid_domains %}
+ {% if user.admin %}
+
+ {% else %}
+
+ There are no domains available for this user account.
+
+ {% endif %}
+ {% else %}
+
+ {% endif %}
{% endblock %}
diff --git a/users/views/identity.py b/users/views/identity.py
index cd6c8bc..a23177c 100644
--- a/users/views/identity.py
+++ b/users/views/identity.py
@@ -370,3 +370,10 @@ class CreateIdentity(FormView):
)
self.request.session["identity_id"] = identity.id
return redirect(identity.urls.view)
+
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ context["user"] = self.request.user
+ if len(context["form"].fields["domain"].choices) == 0:
+ context["no_valid_domains"] = True
+ return context