Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create setting with invalid value in data migration #13576

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

AlanCoding
Copy link
Member

SUMMARY

Do a new install and check /api/v2/settings/ldap/

    "AUTH_LDAP_GROUP_TYPE_PARAMS": {},

This is an invalid value, and will fail the validation not for itself, but for AUTH_LDAP_GROUP_TYPE, which uses these params to initialize a library object. The class of that object takes a positional argument, so {} throws an exception, not meeting the method signature.

Check the settings in the database.

In [1]: Setting.objects.all()
Out[1]: <QuerySet [<Setting: AUTH_LDAP_GROUP_TYPE_PARAMS = {}>, <Setting: INSTALL_UUID = "19f61c3a-b386-43f8-a31d-8e744bc2fa50">]>

The data migration created an entry for this key.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

@AlanCoding AlanCoding marked this pull request as ready for review February 15, 2023 15:05
@AlanCoding AlanCoding merged commit 7f50679 into ansible:devel Feb 15, 2023
jjwatt pushed a commit to jjwatt/awx that referenced this pull request Mar 3, 2023
…3576)

* Do not create setting with invalid value in data migration

* Add test for conf app data migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants