mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-29 19:33:20 +01:00
Merge pull request #453 from willstott101/stringio_six
Use Django's six module for StringIO imports.
This commit is contained in:
commit
73fd081b48
@ -8,10 +8,7 @@ forms.py - Definitions of newforms-based forms for creating and maintaining
|
|||||||
"""
|
"""
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
|
|
||||||
try:
|
from django.utils.six import StringIO
|
||||||
from StringIO import StringIO
|
|
||||||
except ImportError:
|
|
||||||
from io import StringIO
|
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.forms import extras
|
from django.forms import extras
|
||||||
|
@ -1388,7 +1388,7 @@ class CustomField(models.Model):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _choices_as_array(self):
|
def _choices_as_array(self):
|
||||||
from StringIO import StringIO
|
from django.utils.six import StringIO
|
||||||
valuebuffer = StringIO(self.list_values)
|
valuebuffer = StringIO(self.list_values)
|
||||||
choices = [[item.strip(), item.strip()] for item in valuebuffer.readlines()]
|
choices = [[item.strip(), item.strip()] for item in valuebuffer.readlines()]
|
||||||
valuebuffer.close()
|
valuebuffer.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user