mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 03:59:21 -02:30
Replace all previously text-based json fields with JSONBlob
This JSONBlob field type is a wrapper around Django's new generic JSONField, but with the database column type forced to be text. This should behave close enough to our old wrapper around django-jsonfield's JSONField and will avoid needing to do the out-of-band database migration.
This commit is contained in:
@@ -8,6 +8,7 @@ import json
|
||||
from django.db import models
|
||||
|
||||
# AWX
|
||||
from awx.main.fields import JSONBlob
|
||||
from awx.main.models.base import CreatedModifiedModel, prevent_search
|
||||
from awx.main.utils import encrypt_field
|
||||
from awx.conf import settings_registry
|
||||
@@ -18,7 +19,7 @@ __all__ = ['Setting']
|
||||
class Setting(CreatedModifiedModel):
|
||||
|
||||
key = models.CharField(max_length=255)
|
||||
value = models.JSONField(null=True)
|
||||
value = JSONBlob(null=True)
|
||||
user = prevent_search(models.ForeignKey('auth.User', related_name='settings', default=None, null=True, editable=False, on_delete=models.CASCADE))
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user