diff --git a/passbook/sources/ldap/forms.py b/passbook/sources/ldap/forms.py
index 6536241d8..187a9d5dd 100644
--- a/passbook/sources/ldap/forms.py
+++ b/passbook/sources/ldap/forms.py
@@ -4,6 +4,7 @@ from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.utils.translation import gettext_lazy as _
+from passbook.admin.fields import CodeMirrorWidget
from passbook.admin.forms.source import SOURCE_FORM_FIELDS
from passbook.core.expression import PropertyMappingEvaluator
from passbook.sources.ldap.models import LDAPPropertyMapping, LDAPSource
@@ -68,4 +69,8 @@ class LDAPPropertyMappingForm(forms.ModelForm):
"name": forms.TextInput(),
"ldap_property": forms.TextInput(),
"object_field": forms.TextInput(),
+ "expression": CodeMirrorWidget(mode="python"),
+ }
+ help_texts = {
+ "object_field": _("Field of the user object this value is written to.")
}
diff --git a/passbook/sources/ldap/templates/ldap/property_mapping_form.html b/passbook/sources/ldap/templates/ldap/property_mapping_form.html
index 63887ba7d..4bd3085af 100644
--- a/passbook/sources/ldap/templates/ldap/property_mapping_form.html
+++ b/passbook/sources/ldap/templates/ldap/property_mapping_form.html
@@ -7,10 +7,7 @@