mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00
Merge @dadosch's changes & fix dependency conflicts
This commit is contained in:
commit
2d4008371b
2
Pipfile
2
Pipfile
@ -4,7 +4,7 @@ verify_ssl = true
|
|||||||
name = "pypi"
|
name = "pypi"
|
||||||
|
|
||||||
[packages]
|
[packages]
|
||||||
django = "<2.0,>=1.11"
|
django = "<2.1,>=2.0"
|
||||||
pillow = "*"
|
pillow = "*"
|
||||||
coveralls = "*"
|
coveralls = "*"
|
||||||
dateparser = "*"
|
dateparser = "*"
|
||||||
|
8
Pipfile.lock
generated
8
Pipfile.lock
generated
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "f38e72c2d07bd711cf7b3dd168e4fa39df3e8b86f790bda8c2c27a762c6f7447"
|
"sha256": "f349fa350cdef16f1b8673d7a317516c0682a801e2039d1d7dc25d90ea2aed38"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {},
|
"requires": {},
|
||||||
@ -106,11 +106,11 @@
|
|||||||
},
|
},
|
||||||
"django": {
|
"django": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:8176ac7985fe6737ce3d6b2531b4a2453cb7c3377c9db00bacb2b3320f4a1311",
|
"sha256:0c5b65847d00845ee404bbc0b4a85686f15eb3001ffddda3db4e9baa265bf136",
|
||||||
"sha256:b18235d82426f09733d2de9910cee975cf52ff05e5f836681eb957d105a05a40"
|
"sha256:68aeea369a8130259354b6ba1fa9babe0c5ee6bced505dea4afcd00f765ae38b"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==1.11.15"
|
"version": "==2.0.8"
|
||||||
},
|
},
|
||||||
"django-cors-headers": {
|
"django-cors-headers": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
|
@ -12,7 +12,7 @@ django-crispy-forms==1.7.2
|
|||||||
django-extensions==2.1.2
|
django-extensions==2.1.2
|
||||||
django-filter==2.0.0
|
django-filter==2.0.0
|
||||||
django-flat-responsive==2.0
|
django-flat-responsive==2.0
|
||||||
django==1.11.15
|
django==2.0.8
|
||||||
djangorestframework==3.8.2
|
djangorestframework==3.8.2
|
||||||
docopt==0.6.2
|
docopt==0.6.2
|
||||||
execnet==1.5.0; python_version != '3.1.*'
|
execnet==1.5.0; python_version != '3.1.*'
|
||||||
|
@ -3,8 +3,13 @@ from datetime import datetime
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.contrib.auth.models import User, Group
|
from django.contrib.auth.models import User, Group
|
||||||
|
try:
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
except ImportError:
|
||||||
|
from django.urls import reverse
|
||||||
from django.templatetags.static import static
|
from django.templatetags.static import static
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
|
from django.utils.html import format_html, format_html_join
|
||||||
|
|
||||||
from .models import Correspondent, Tag, Document, Log
|
from .models import Correspondent, Tag, Document, Log
|
||||||
|
|
||||||
@ -178,7 +183,7 @@ class DocumentAdmin(CommonAdmin):
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return r
|
return mark_safe(r)
|
||||||
tags_.allow_tags = True
|
tags_.allow_tags = True
|
||||||
|
|
||||||
def document(self, obj):
|
def document(self, obj):
|
||||||
@ -198,16 +203,13 @@ class DocumentAdmin(CommonAdmin):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _html_tag(kind, inside=None, **kwargs):
|
def _html_tag(kind, inside=None, **kwargs):
|
||||||
|
attributes = format_html_join(' ', '{}="{}"', kwargs.items())
|
||||||
attributes = []
|
|
||||||
for lft, rgt in kwargs.items():
|
|
||||||
attributes.append('{}="{}"'.format(lft, rgt))
|
|
||||||
|
|
||||||
if inside is not None:
|
if inside is not None:
|
||||||
return "<{kind} {attributes}>{inside}</{kind}>".format(
|
return format_html("<{kind} {attributes}>{inside}</{kind}>",
|
||||||
kind=kind, attributes=" ".join(attributes), inside=inside)
|
kind=kind, attributes=attributes, inside=inside)
|
||||||
|
|
||||||
return "<{} {}/>".format(kind, " ".join(attributes))
|
return format_html("<{} {}/>", kind, attributes)
|
||||||
|
|
||||||
|
|
||||||
class LogAdmin(CommonAdmin):
|
class LogAdmin(CommonAdmin):
|
||||||
|
@ -32,7 +32,6 @@ def realign_senders(apps, schema_editor):
|
|||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('documents', '0002_auto_20151226_1316'),
|
('documents', '0002_auto_20151226_1316'),
|
||||||
]
|
]
|
||||||
|
@ -6,7 +6,7 @@ from django.db import migrations
|
|||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
atomic = False
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('documents', '0010_log'),
|
('documents', '0010_log'),
|
||||||
]
|
]
|
||||||
|
@ -112,7 +112,6 @@ def move_documents_and_create_thumbnails(apps, schema_editor):
|
|||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('documents', '0011_auto_20160303_1929'),
|
('documents', '0011_auto_20160303_1929'),
|
||||||
]
|
]
|
||||||
|
@ -128,7 +128,6 @@ def do_nothing(apps, schema_editor):
|
|||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('documents', '0013_auto_20160325_2111'),
|
('documents', '0013_auto_20160325_2111'),
|
||||||
]
|
]
|
||||||
|
@ -15,7 +15,6 @@ def reverse_func(apps, schema_editor):
|
|||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('documents', '0018_auto_20170715_1712'),
|
('documents', '0018_auto_20170715_1712'),
|
||||||
]
|
]
|
||||||
|
@ -12,7 +12,6 @@ def set_added_time_to_created_time(apps, schema_editor):
|
|||||||
doc.save()
|
doc.save()
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('documents', '0019_add_consumer_user'),
|
('documents', '0019_add_consumer_user'),
|
||||||
]
|
]
|
||||||
|
@ -10,7 +10,10 @@ from collections import OrderedDict
|
|||||||
from fuzzywuzzy import fuzz
|
from fuzzywuzzy import fuzz
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
try:
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
|
except ImportError:
|
||||||
|
from django.urls import reverse
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
@ -82,14 +82,13 @@ if os.getenv("PAPERLESS_INSTALLED_APPS"):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
MIDDLEWARE_CLASSES = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
'corsheaders.middleware.CorsMiddleware',
|
'corsheaders.middleware.CorsMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'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 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")):
|
if bool(os.getenv("PAPERLESS_DISABLE_LOGIN", "false").lower() in ("yes", "y", "1", "t", "true")):
|
||||||
_index = MIDDLEWARE_CLASSES.index("django.contrib.auth.middleware.AuthenticationMiddleware")
|
_index = MIDDLEWARE.index("django.contrib.auth.middleware.AuthenticationMiddleware")
|
||||||
MIDDLEWARE_CLASSES[_index] = "paperless.middleware.Middleware"
|
MIDDLEWARE[_index] = "paperless.middleware.Middleware"
|
||||||
MIDDLEWARE_CLASSES.remove("django.contrib.auth.middleware.SessionAuthenticationMiddleware")
|
MIDDLEWARE.remove("django.contrib.auth.middleware.SessionAuthenticationMiddleware")
|
||||||
|
|
||||||
ROOT_URLCONF = 'paperless.urls'
|
ROOT_URLCONF = 'paperless.urls'
|
||||||
|
|
||||||
|
@ -28,9 +28,11 @@ urlpatterns = [
|
|||||||
# API
|
# API
|
||||||
url(
|
url(
|
||||||
r"^api/auth/",
|
r"^api/auth/",
|
||||||
include('rest_framework.urls', namespace="rest_framework")
|
include(
|
||||||
|
('rest_framework.urls', 'rest_framework'),
|
||||||
|
namespace="rest_framework")
|
||||||
),
|
),
|
||||||
url(r"^api/", include(router.urls, namespace="drf")),
|
url(r"^api/", include((router.urls, 'drf'), namespace="drf")),
|
||||||
|
|
||||||
# File downloads
|
# File downloads
|
||||||
url(
|
url(
|
||||||
|
@ -3,6 +3,8 @@ from django.db import models
|
|||||||
|
|
||||||
class Reminder(models.Model):
|
class Reminder(models.Model):
|
||||||
|
|
||||||
document = models.ForeignKey("documents.Document")
|
document = models.ForeignKey(
|
||||||
|
"documents.Document", on_delete=models.PROTECT
|
||||||
|
)
|
||||||
date = models.DateTimeField()
|
date = models.DateTimeField()
|
||||||
note = models.TextField(blank=True)
|
note = models.TextField(blank=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user