policies/expression: migrate to raw python instead of jinja2 (#49)
* policies/expression: migrate to raw python instead of jinja2 * lib/expression: create base evaluator, custom subclass for policies * core: rewrite propertymappings to use python * providers/saml: update to new PropertyMappings * sources/ldap: update to new PropertyMappings * docs: update docs for new propertymappings * root: remove jinja2 * root: re-add jinja to lock file as its implicitly required
This commit is contained in:
		| @ -7,11 +7,11 @@ from django.db import migrations | ||||
| def create_default_ad_property_mappings(apps: Apps, schema_editor): | ||||
|     LDAPPropertyMapping = apps.get_model("passbook_sources_ldap", "LDAPPropertyMapping") | ||||
|     mapping = { | ||||
|         "name": "{{ ldap.name }}", | ||||
|         "first_name": "{{ ldap.givenName }}", | ||||
|         "last_name": "{{ ldap.sn }}", | ||||
|         "username": "{{ ldap.sAMAccountName }}", | ||||
|         "email": "{{ ldap.mail }}", | ||||
|         "name": "return ldap.get('name')", | ||||
|         "first_name": "return ldap.get('givenName')", | ||||
|         "last_name": "return ldap.get('sn')", | ||||
|         "username": "return ldap.get('sAMAccountName')", | ||||
|         "email": "return ldap.get('mail')", | ||||
|     } | ||||
|     db_alias = schema_editor.connection.alias | ||||
|     for object_field, expression in mapping.items(): | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens L
					Jens L