Преглед изворни кода

Closes #5313: Denote official support for Python 3.8

Jeremy Stretch пре 5 година
родитељ
комит
39b322ae6b
4 измењених фајлова са 5 додато и 4 уклоњено
  1. 1 0
      .travis.yml
  2. 1 1
      docs/index.md
  3. 1 1
      docs/installation/3-netbox.md
  4. 2 2
      netbox/netbox/api/fields.py

+ 1 - 0
.travis.yml

@@ -8,6 +8,7 @@ language: python
 python:
 python:
   - "3.6"
   - "3.6"
   - "3.7"
   - "3.7"
+  - "3.8"
 install:
 install:
   - pip install -r requirements.txt
   - pip install -r requirements.txt
   - pip install pycodestyle
   - pip install pycodestyle

+ 1 - 1
docs/index.md

@@ -55,7 +55,7 @@ NetBox is built on the [Django](https://djangoproject.com/) Python framework and
 
 
 ## Supported Python Versions
 ## Supported Python Versions
 
 
-NetBox supports Python 3.6 and 3.7 environments currently. (Support for Python 3.5 was removed in NetBox v2.8.)
+NetBox supports Python 3.6, 3.7, and 3.8 environments currently. (Support for Python 3.5 was removed in NetBox v2.8.)
 
 
 ## Getting Started
 ## Getting Started
 
 

+ 1 - 1
docs/installation/3-netbox.md

@@ -7,7 +7,7 @@ This section of the documentation discusses installing and configuring the NetBo
 Begin by installing all system packages required by NetBox and its dependencies.
 Begin by installing all system packages required by NetBox and its dependencies.
 
 
 !!! note
 !!! note
-    NetBox v2.8.0 and later require Python 3.6 or 3.7. This documentation assumes Python 3.6.
+    NetBox v2.8.0 and later require Python 3.6, 3.7, or 3.8. This documentation assumes Python 3.6.
 
 
 ### Ubuntu
 ### Ubuntu
 
 

+ 2 - 2
netbox/netbox/api/fields.py

@@ -40,7 +40,7 @@ class ChoiceField(serializers.Field):
         return super().validate_empty_values(data)
         return super().validate_empty_values(data)
 
 
     def to_representation(self, obj):
     def to_representation(self, obj):
-        if obj is '':
+        if obj == '':
             return None
             return None
         return OrderedDict([
         return OrderedDict([
             ('value', obj),
             ('value', obj),
@@ -48,7 +48,7 @@ class ChoiceField(serializers.Field):
         ])
         ])
 
 
     def to_internal_value(self, data):
     def to_internal_value(self, data):
-        if data is '':
+        if data == '':
             if self.allow_blank:
             if self.allow_blank:
                 return data
                 return data
             raise ValidationError("This field may not be blank.")
             raise ValidationError("This field may not be blank.")