web/admin: fix inconsistent ordering for ldap property mappings

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-24 13:03:53 +02:00
parent 2ec1ff2ebb
commit cc6d5765f2
2 changed files with 4 additions and 4 deletions

View File

@ -27,10 +27,10 @@ class LDAPSourceSerializer(SourceSerializer):
"""Check that only a single source has password_sync on""" """Check that only a single source has password_sync on"""
sync_users_password = attrs.get("sync_users_password", True) sync_users_password = attrs.get("sync_users_password", True)
if sync_users_password: if sync_users_password:
filter = LDAPSource.objects.filter(sync_users_password=True) sources = LDAPSource.objects.filter(sync_users_password=True)
if self.instance: if self.instance:
filter = filter.exclude(pk=self.instance.pk) sources = sources.exclude(pk=self.instance.pk)
if filter.exists(): if sources.exists():
raise ValidationError( raise ValidationError(
"Only a single LDAP Source with password synchronization is allowed" "Only a single LDAP Source with password synchronization is allowed"
) )

View File

@ -213,7 +213,7 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
${until( ${until(
new PropertymappingsApi(DEFAULT_CONFIG) new PropertymappingsApi(DEFAULT_CONFIG)
.propertymappingsLdapList({ .propertymappingsLdapList({
ordering: "object_field", ordering: "managed,object_field",
}) })
.then((mappings) => { .then((mappings) => {
return mappings.results.map((mapping) => { return mappings.results.map((mapping) => {