apply some patches from @brookst

This commit is contained in:
dadosch
2018-08-29 00:04:48 +02:00
parent 1f293f2693
commit 7fb3204b3b
10 changed files with 36 additions and 18 deletions

View File

@@ -32,7 +32,7 @@ def realign_senders(apps, schema_editor):
class Migration(migrations.Migration):
atomic = False
dependencies = [
('documents', '0002_auto_20151226_1316'),
]

View File

@@ -6,7 +6,7 @@ from django.db import migrations
class Migration(migrations.Migration):
atomic = False
dependencies = [
('documents', '0010_log'),
]

View File

@@ -112,7 +112,7 @@ def move_documents_and_create_thumbnails(apps, schema_editor):
class Migration(migrations.Migration):
atomic = False
dependencies = [
('documents', '0011_auto_20160303_1929'),
]

View File

@@ -128,7 +128,7 @@ def do_nothing(apps, schema_editor):
class Migration(migrations.Migration):
atomic = False
dependencies = [
('documents', '0013_auto_20160325_2111'),
]

View File

@@ -15,7 +15,7 @@ def reverse_func(apps, schema_editor):
class Migration(migrations.Migration):
atomic = False
dependencies = [
('documents', '0018_auto_20170715_1712'),
]

View File

@@ -12,7 +12,7 @@ def set_added_time_to_created_time(apps, schema_editor):
doc.save()
class Migration(migrations.Migration):
atomic = False
dependencies = [
('documents', '0019_add_consumer_user'),
]

View File

@@ -82,14 +82,13 @@ if os.getenv("PAPERLESS_INSTALLED_APPS"):
MIDDLEWARE_CLASSES = [
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
@@ -99,9 +98,9 @@ CORS_ORIGIN_WHITELIST = tuple(os.getenv("PAPERLESS_CORS_ALLOWED_HOSTS", "localho
# If auth is disabled, we just use our "bypass" authentication middleware
if bool(os.getenv("PAPERLESS_DISABLE_LOGIN", "false").lower() in ("yes", "y", "1", "t", "true")):
_index = MIDDLEWARE_CLASSES.index("django.contrib.auth.middleware.AuthenticationMiddleware")
MIDDLEWARE_CLASSES[_index] = "paperless.middleware.Middleware"
MIDDLEWARE_CLASSES.remove("django.contrib.auth.middleware.SessionAuthenticationMiddleware")
_index = MIDDLEWARE.index("django.contrib.auth.middleware.AuthenticationMiddleware")
MIDDLEWARE[_index] = "paperless.middleware.Middleware"
MIDDLEWARE.remove("django.contrib.auth.middleware.SessionAuthenticationMiddleware")
ROOT_URLCONF = 'paperless.urls'

View File

@@ -0,0 +1,19 @@
# Generated by Django 2.1 on 2018-08-24 20:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('reminders', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='reminder',
name='document',
field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='documents.Document'),
),
]

View File

@@ -4,7 +4,7 @@ from django.db import models
class Reminder(models.Model):
document = models.ForeignKey(
"documents.Document", on_delete=models.DO_NOTHING
"documents.Document", on_delete=models.PROTECTION
)
date = models.DateTimeField()
note = models.TextField(blank=True)