Merge pull request #704 from akai16/patch-1

Specify the user model using the AUTH_USER_MODEL setting
pull/705/head
Piero Toffanin 2019-07-17 15:27:47 -04:00 zatwierdzone przez GitHub
commit bd5008efe9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -1,13 +1,13 @@
import logging
from django.db import models
from django.contrib.postgres import fields
from django.contrib.auth.models import User
from django.conf import settings
logger = logging.getLogger('app.logger')
class PluginDatum(models.Model):
key = models.CharField(max_length=255, help_text="Setting key", db_index=True)
user = models.ForeignKey(User, null=True, default=None, on_delete=models.CASCADE, help_text="The user this setting belongs to. If NULL, the setting is global.")
user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, default=None, on_delete=models.CASCADE, help_text="The user this setting belongs to. If NULL, the setting is global.")
int_value = models.IntegerField(blank=True, null=True, default=None, help_text="Integer value")
float_value = models.FloatField(blank=True, null=True, default=None, help_text="Float value")
bool_value = models.NullBooleanField(blank=True, null=True, default=None, help_text="Bool value")

Wyświetl plik

@ -1,6 +1,6 @@
import logging
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.utils import timezone
@ -10,7 +10,7 @@ logger = logging.getLogger('app.logger')
class Preset(models.Model):
owner = models.ForeignKey(User, blank=True, null=True, on_delete=models.CASCADE, help_text="The person who owns this preset")
owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, on_delete=models.CASCADE, help_text="The person who owns this preset")
name = models.CharField(max_length=255, blank=False, null=False, help_text="A label used to describe the preset")
options = JSONField(default=list, blank=True, help_text="Options that define this preset (same format as in a Task's options).",
validators=[validate_task_options])

Wyświetl plik

@ -1,6 +1,6 @@
import logging
from django.contrib.auth.models import User
from django.conf import settings
from django.db import models
from django.db.models import Q
from django.db.models import signals
@ -18,7 +18,7 @@ logger = logging.getLogger('app.logger')
class Project(models.Model):
owner = models.ForeignKey(User, on_delete=models.PROTECT, help_text="The person who created the project")
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, help_text="The person who created the project")
name = models.CharField(max_length=255, help_text="A label used to describe the project")
description = models.TextField(default="", blank=True, help_text="More in-depth description of the project")
created_at = models.DateTimeField(default=timezone.now, help_text="Creation date")