all: implement black as code formatter

This commit is contained in:
Jens Langhammer
2019-12-31 12:51:16 +01:00
parent 8eb3f0f708
commit 3bd1eadd51
298 changed files with 4825 additions and 3145 deletions

View File

@ -5,28 +5,28 @@ from django.db import migrations
def create_default_ad_property_mappings(apps: Apps, schema_editor):
LDAPPropertyMapping = apps.get_model('passbook_sources_ldap', 'LDAPPropertyMapping')
LDAPPropertyMapping = apps.get_model("passbook_sources_ldap", "LDAPPropertyMapping")
mapping = {
'name': 'name',
'givenName': 'first_name',
'sn': 'last_name',
'sAMAccountName': 'username',
'mail': 'email'
"name": "name",
"givenName": "first_name",
"sn": "last_name",
"sAMAccountName": "username",
"mail": "email",
}
for ldap_property, object_field in mapping.items():
LDAPPropertyMapping.objects.get_or_create(
ldap_property=ldap_property,
object_field=object_field,
defaults={
'name': f"Autogenerated LDAP Mapping: {ldap_property} -> {object_field}"
})
"name": f"Autogenerated LDAP Mapping: {ldap_property} -> {object_field}"
},
)
class Migration(migrations.Migration):
dependencies = [
('passbook_sources_ldap', '0002_auto_20191011_0825'),
("passbook_sources_ldap", "0002_auto_20191011_0825"),
]
operations = [
migrations.RunPython(create_default_ad_property_mappings)
]
operations = [migrations.RunPython(create_default_ad_property_mappings)]