mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 09:53:34 -06:00
Merge pull request #4207 from netbox-community/3848-django-3.0
Closes #3848: Django 3.0
This commit is contained in:
commit
38ff01e874
@ -3,10 +3,10 @@ services:
|
|||||||
- postgresql
|
- postgresql
|
||||||
- redis-server
|
- redis-server
|
||||||
addons:
|
addons:
|
||||||
postgresql: "9.4"
|
postgresql: "9.6"
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "3.5"
|
- "3.6"
|
||||||
install:
|
install:
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- pip install pycodestyle
|
- pip install pycodestyle
|
||||||
|
28
netbox/dcim/migrations/0097_mptt_remove_indexes.py
Normal file
28
netbox/dcim/migrations/0097_mptt_remove_indexes.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Generated by Django 3.0.3 on 2020-02-18 21:02
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('dcim', '0096_interface_ordering'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='region',
|
||||||
|
name='level',
|
||||||
|
field=models.PositiveIntegerField(editable=False),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='region',
|
||||||
|
name='lft',
|
||||||
|
field=models.PositiveIntegerField(editable=False),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='region',
|
||||||
|
name='rght',
|
||||||
|
field=models.PositiveIntegerField(editable=False),
|
||||||
|
),
|
||||||
|
]
|
@ -40,7 +40,7 @@ class AppTest(APITestCase):
|
|||||||
self.assertEqual(choices_to_dict(response.data.get('cable:status')), CableStatusChoices.as_dict())
|
self.assertEqual(choices_to_dict(response.data.get('cable:status')), CableStatusChoices.as_dict())
|
||||||
content_types = ContentType.objects.filter(CABLE_TERMINATION_MODELS)
|
content_types = ContentType.objects.filter(CABLE_TERMINATION_MODELS)
|
||||||
cable_termination_choices = {
|
cable_termination_choices = {
|
||||||
"{}.{}".format(ct.app_label, ct.model): ct.name for ct in content_types
|
"{}.{}".format(ct.app_label, ct.model): str(ct) for ct in content_types
|
||||||
}
|
}
|
||||||
self.assertEqual(choices_to_dict(response.data.get('cable:termination_a_type')), cable_termination_choices)
|
self.assertEqual(choices_to_dict(response.data.get('cable:termination_a_type')), cable_termination_choices)
|
||||||
self.assertEqual(choices_to_dict(response.data.get('cable:termination_b_type')), cable_termination_choices)
|
self.assertEqual(choices_to_dict(response.data.get('cable:termination_b_type')), cable_termination_choices)
|
||||||
|
@ -467,7 +467,8 @@ class ScriptForm(BootstrapMixin, forms.Form):
|
|||||||
self.fields['_commit'].initial = False
|
self.fields['_commit'].initial = False
|
||||||
|
|
||||||
# Move _commit to the end of the form
|
# Move _commit to the end of the form
|
||||||
self.fields.move_to_end('_commit', True)
|
commit = self.fields.pop('_commit')
|
||||||
|
self.fields['_commit'] = commit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def requires_input(self):
|
def requires_input(self):
|
||||||
|
@ -37,7 +37,7 @@ class AppTest(APITestCase):
|
|||||||
# Graph
|
# Graph
|
||||||
content_types = ContentType.objects.filter(GRAPH_MODELS)
|
content_types = ContentType.objects.filter(GRAPH_MODELS)
|
||||||
graph_type_choices = {
|
graph_type_choices = {
|
||||||
"{}.{}".format(ct.app_label, ct.model): ct.name for ct in content_types
|
"{}.{}".format(ct.app_label, ct.model): str(ct) for ct in content_types
|
||||||
}
|
}
|
||||||
self.assertEqual(choices_to_dict(response.data.get('graph:type')), graph_type_choices)
|
self.assertEqual(choices_to_dict(response.data.get('graph:type')), graph_type_choices)
|
||||||
self.assertEqual(choices_to_dict(response.data.get('graph:template_language')), TemplateLanguageChoices.as_dict())
|
self.assertEqual(choices_to_dict(response.data.get('graph:template_language')), TemplateLanguageChoices.as_dict())
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
# TODO: Rename the secrets app, probably
|
||||||
|
# Python 3.6 introduced a standard library named "secrets," which obviously conflicts with this Django app. To avoid
|
||||||
|
# renaming the app, we hotwire the components of the standard library that Django calls. (I don't like this any more
|
||||||
|
# than you do, but it works for now.) The only references to the secrets modules are in django/utils/crypto.py.
|
||||||
|
#
|
||||||
|
# First, we copy secrets.compare_digest, which comes from the hmac module:
|
||||||
|
from hmac import compare_digest
|
||||||
|
|
||||||
|
# Then, we instantiate SystemRandom and map its choice() function:
|
||||||
|
from random import SystemRandom
|
||||||
|
choice = SystemRandom().choice
|
@ -1,9 +1,9 @@
|
|||||||
Django>=2.2,<2.3
|
Django>=3.0,<3.1
|
||||||
django-cacheops==4.2
|
django-cacheops==4.2
|
||||||
django-cors-headers==3.2.1
|
django-cors-headers==3.2.1
|
||||||
django-debug-toolbar==2.1
|
django-debug-toolbar==2.2
|
||||||
django-filter==2.2.0
|
django-filter==2.2.0
|
||||||
django-mptt==0.9.1
|
django-mptt==0.11.0
|
||||||
django-pglocks==1.0.4
|
django-pglocks==1.0.4
|
||||||
django-prometheus==1.1.0
|
django-prometheus==1.1.0
|
||||||
django-rq==2.2.0
|
django-rq==2.2.0
|
||||||
|
Loading…
Reference in New Issue
Block a user