Skip to content

Commit

Permalink
Fix empty entry in demo list
Browse files Browse the repository at this point in the history
The fetch_versions.py was including an empty entry in the demo server
list.

Replaces the legacy RawConfigParser object with
ConfigParser(interpolation=None).

Signed-off-by: Maurício Meneghini Fauth <[email protected]>
  • Loading branch information
MauricioFauth committed Oct 4, 2023
1 parent beda0f2 commit b973250
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions demo/management/commands/fetch_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

from collections import OrderedDict
from configparser import RawConfigParser
from configparser import ConfigParser
import urllib.request, urllib.parse, urllib.error

from django.core.management.base import BaseCommand
Expand All @@ -47,7 +47,7 @@ class Command(BaseCommand):

def handle(self, *args, **options):
handle = urllib.request.urlopen(URL)
config = RawConfigParser(dict_type=MultiOrderedDict, strict=False)
config = ConfigParser(dict_type=MultiOrderedDict, strict=False, empty_lines_in_values=False, interpolation=None)
try:
config.read_string(handle.read().decode('utf-8'))
except Exception as e:
Expand All @@ -60,13 +60,13 @@ def handle(self, *args, **options):
import sys
sys.exit(1)

master = config.get('demo', 'master-release')[0]
master = config['demo']['master-release'][0]

modified = False

processed = set()

for version in config.get('demo', 'branches[]'):
for version in config['demo']['branches[]']:
demo, created = Demo.objects.get_or_create(
name=version,
defaults={'master_version': master}
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# vim: set expandtab sw=4 ts=4 sts=4:
#
Expand Down

0 comments on commit b973250

Please sign in to comment.