Skip to content

Commit 5638122

Browse files
committed
ref(config): remove legacy guard for JSONField
1 parent 3c6ea6c commit 5638122

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

rootfs/api/models/config.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,8 @@ def save(self, **kwargs):
114114
try:
115115
previous_config = self.app.config_set.latest()
116116
for attr in ['cpu', 'memory', 'tags', 'registry', 'values']:
117-
# Guard against migrations from older apps without fixes to
118-
# JSONField encoding.
119-
try:
120-
data = getattr(previous_config, attr).copy()
121-
except AttributeError:
122-
data = {}
123-
124-
try:
125-
new_data = getattr(self, attr).copy()
126-
except AttributeError:
127-
new_data = {}
117+
data = getattr(previous_config, attr, {}).copy()
118+
new_data = getattr(self, attr, {}).copy()
128119

129120
data.update(new_data)
130121
# remove config keys if we provided a null value

0 commit comments

Comments
 (0)