aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-05-12 16:22:43 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-05-12 16:22:43 +0300
commit71226657449ae821f6a89682eb2a8873aaad8210 (patch)
tree55dafa63d24d43090aaf4309dff2bc57a2ba0182
parent20f14c505de3f0f327aecc30aeea8d32e57f13b8 (diff)
downloadServo-71226657449ae821f6a89682eb2a8873aaad8210.tar.gz
Servo-71226657449ae821f6a89682eb2a8873aaad8210.tar.bz2
Servo-71226657449ae821f6a89682eb2a8873aaad8210.zip
Fix manage check warnings
-rw-r--r--servo/models/device.py2
-rw-r--r--servo/models/note.py4
-rw-r--r--servo/models/repair.py6
-rw-r--r--settings.py23
4 files changed, 30 insertions, 5 deletions
diff --git a/servo/models/device.py b/servo/models/device.py
index 6487179..a506874 100644
--- a/servo/models/device.py
+++ b/servo/models/device.py
@@ -79,7 +79,7 @@ class Device(models.Model):
max_length=128,
verbose_name=_("Next Tether Policy")
)
- unlocked = models.NullBooleanField(default=None, editable=False)
+ unlocked = models.BooleanField(default=None, editable=False, null=True)
slug = models.SlugField(null=True, editable=False, max_length=128)
PRODUCT_LINES = gsxws.products.models()
LINE_CHOICES = [(k, x['name']) for k, x in PRODUCT_LINES.items()]
diff --git a/servo/models/note.py b/servo/models/note.py
index 52aacb7..77865cd 100644
--- a/servo/models/note.py
+++ b/servo/models/note.py
@@ -652,8 +652,8 @@ class Article(models.Model):
product_model = ArrayField(models.CharField(max_length=128),
null=True,
editable=False)
- read_by = ArrayField(models.IntegerField(), default=[])
- flagged_by = ArrayField(models.IntegerField(), default=[])
+ read_by = ArrayField(models.IntegerField(), default=list)
+ flagged_by = ArrayField(models.IntegerField(), default=list)
def get_creation_date(self):
return self.date_created
diff --git a/servo/models/repair.py b/servo/models/repair.py
index 3568684..6af3d32 100644
--- a/servo/models/repair.py
+++ b/servo/models/repair.py
@@ -190,12 +190,14 @@ class Repair(models.Model):
)
component_data = models.TextField(default='', editable=False)
- consumer_law = models.NullBooleanField(
+ consumer_law = models.BooleanField(
default=None,
+ null=True,
help_text=_('Repair is eligible for consumer law coverage')
)
- acplus = models.NullBooleanField(
+ acplus = models.BooleanField(
default=None,
+ null=True,
verbose_name=_('AppleCare+'),
help_text=_('Repair is covered by AppleCare+')
)
diff --git a/settings.py b/settings.py
index c53a3c7..fb8d9a2 100644
--- a/settings.py
+++ b/settings.py
@@ -51,6 +51,11 @@ STATICFILES_FINDERS = (
# Absolute path to the directory that will hold temporary files.
TEMP_ROOT = os.path.join(MEDIA_ROOT, 'temp')
+# Default primary key field type
+# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
+
+DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE_CLASSES = (
@@ -73,6 +78,24 @@ SESSION_SERIALIZER = 'servo.lib.utils.SessionSerializer'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'wsgi.application'
+# Password validation
+# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ },
+]
+
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',