Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Merge remote-tracking branch 'upstream/dev' into feature/unsaved-changes

Michael Shamoon2a7bb27a78a9
diff --git a/crowdin.yml b/crowdin.yml
new file mode 100644
index 000000000..f5a7765dd
--- /dev/null
+++ b/crowdin.yml
@@ -0,0 +1,5 @@
+files:
+ - source: /src/locale/en-us/LC_MESSAGES/django.po
+ translation: /src/locale/%two_letters_code%/LC_MESSAGES/django.po
+ - source: /src-ui/messages.xlf
+ translation: /src-ui/src/locale/messages.%two_letters_code%.xlf
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh
index 8e1a21757..5919b14aa 100644
--- a/docker/docker-entrypoint.sh
+++ b/docker/docker-entrypoint.sh
@@ -79,7 +79,11 @@ initialize() {
fi
done
+ echo "creating directory /tmp/paperless"
+ mkdir -p /tmp/paperless
+
chown -R paperless:paperless ../
+ chown -R paperless:paperless /tmp/paperless
migrations
diff --git a/docs/administration.rst b/docs/administration.rst
index bb543e3db..14b986e82 100644
--- a/docs/administration.rst
+++ b/docs/administration.rst
@@ -90,10 +90,28 @@ B. If you built the image yourself, do the following:
$ docker-compose build
$ docker-compose up
-Running `docker-compose up` will also apply any new database migrations.
+Running ``docker-compose up`` will also apply any new database migrations.
If you see everything working, press CTRL+C once to gracefully stop paperless.
Then you can start paperless-ng with ``-d`` to have it run in the background.
+ .. note::
+
+ In version 0.9.14, the update process was changed. In 0.9.13 and earlier, the
+ docker-compose files specified exact versions and pull won't automatically
+ update to newer versions. In order to enable updates as described above, either
+ get the new ``docker-compose.yml`` file from `here <https://github.com/jonaswinkler/paperless-ng/tree/master/docker/compose>`_
+ or edit the ``docker-compose.yml`` file, find the line that says
+
+ .. code::
+
+ image: jonaswinkler/paperless-ng:0.9.x
+
+ and replace the version with ``latest``:
+
+ .. code::
+
+ image: jonaswinkler/paperless-ng:latest
+
Bare Metal Route
================
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 721e9520e..28bcc00e6 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -5,7 +5,6 @@
Changelog
*********
-
paperless-ng 1.0.0
##################
@@ -25,7 +24,8 @@ Nothing special about this release, but since there are relatively few bug repor
* Added a language selector to the settings.
* Added date format options to the settings.
* Range selection with shift clicking is now possible in the document list.
-
+ * Filtering correspondent, type and tag management pages by name.
+ * Focus "Name" field in dialogs by default.
paperless-ng 0.9.14
diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf
index 1e89a9408..6175cf700 100644
--- a/src-ui/messages.xlf
+++ b/src-ui/messages.xlf
@@ -482,35 +482,35 @@
<source>Saved view &quot;<x id="PH" equiv-text="savedView.name"/>&quot; deleted.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">62</context>
+ <context context-type="linenumber">63</context>
</context-group>
</trans-unit>
<trans-unit id="5647210819299459618" datatype="html">
<source>Settings saved successfully.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">78</context>
+ <context context-type="linenumber">79</context>
</context-group>
</trans-unit>
<trans-unit id="6839066544204061364" datatype="html">
<source>Use system language</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">82</context>
+ <context context-type="linenumber">83</context>
</context-group>
</trans-unit>
<trans-unit id="7729897675462249787" datatype="html">
<source>Use date format of display language</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">86</context>
+ <context context-type="linenumber">87</context>
</context-group>
</trans-unit>
<trans-unit id="8488620293789898901" datatype="html">
<source>Error while storing settings on server: <x id="PH" equiv-text="JSON.stringify(error.error)"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">102</context>
+ <context context-type="linenumber">103</context>
</context-group>
</trans-unit>
<trans-unit id="121cc5391cd2a5115bc2b3160379ee5b36cd7716" datatype="html">
@@ -1463,8 +1463,8 @@
<context context-type="linenumber">12</context>
</context-group>
</trans-unit>
- <trans-unit id="5866254605255506989" datatype="html">
- <source>English</source>
+ <trans-unit id="1206520795340730278" datatype="html">
+ <source>English (US)</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
<context context-type="linenumber">74</context>
diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html
index 85964f528..d26c17159 100644
--- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html
+++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html
@@ -1,6 +1,6 @@
-<div class="card mb-3 shadow-sm" [class.card-selected]="selected" [class.document-card]="selectable" (click)="this.toggleSelected.emit($event)">
+<div class="card mb-3 shadow-sm" [class.card-selected]="selected" [class.document-card]="selectable">
<div class="row no-gutters">
- <div class="col-md-2 d-none d-lg-block doc-img-background rounded-left" [class.doc-img-background-selected]="selected">
+ <div class="col-md-2 d-none d-lg-block doc-img-background rounded-left" [class.doc-img-background-selected]="selected" (click)="this.toggleSelected.emit($event)">
<img [src]="getThumbUrl()" class="card-img doc-img border-right rounded-left">
<div style="top: 0; left: 0" class="position-absolute border-right border-bottom bg-light p-1" [class.document-card-check]="!selected">
diff --git a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html
index a0d0299a5..882de71ed 100644
--- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html
+++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html
@@ -1,6 +1,6 @@
<div class="col p-2 h-100">
- <div class="card h-100 shadow-sm document-card" [class.card-selected]="selected" (click)="this.toggleSelected.emit($event)">
- <div class="border-bottom doc-img-container" [class.doc-img-background-selected]="selected">
+ <div class="card h-100 shadow-sm document-card" [class.card-selected]="selected">
+ <div class="border-bottom doc-img-container" [class.doc-img-background-selected]="selected" (click)="this.toggleSelected.emit($event)">
<img class="card-img doc-img rounded-top" [src]="getThumbUrl()">
<div class="border-right border-bottom bg-light p-1 rounded document-card-check">
diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html
index a29e146bf..cfc2e655d 100644
--- a/src-ui/src/app/components/document-list/document-list.component.html
+++ b/src-ui/src/app/components/document-list/document-list.component.html
@@ -152,7 +152,7 @@
</td>
<td>
<a routerLink="/documents/{{d.id}}" title="Edit document" style="overflow-wrap: anywhere;">{{d.title | documentTitle}}</a>
- <app-tag [tag]="t" *ngFor="let t of d.tags$ | async" class="ml-1" clickable="true" linkTitle="Filter by tag" (click)="clickTag(t.id)"></app-tag>
+ <app-tag [tag]="t" *ngFor="let t of d.tags$ | async" class="ml-1" clickable="true" linkTitle="Filter by tag" (click)="clickTag(t.id);$event.stopPropagation()"></app-tag>
</td>
<td class="d-none d-xl-table-cell">
<ng-container *ngIf="d.document_type">
diff --git a/src-ui/src/app/components/manage/settings/settings.component.html b/src-ui/src/app/components/manage/settings/settings.component.html
index 688100100..367b4ea20 100644
--- a/src-ui/src/app/components/manage/settings/settings.component.html
+++ b/src-ui/src/app/components/manage/settings/settings.component.html
@@ -19,7 +19,7 @@
<div class="col">
<select class="form-control" formControlName="displayLanguage">
- <option *ngFor="let lang of displayLanguageOptions" [ngValue]="lang.code">{{lang.name}}<span *ngIf="lang.code"> ({{lang.englishName}})</span></option>
+ <option *ngFor="let lang of displayLanguageOptions" [ngValue]="lang.code">{{lang.name}}<span *ngIf="lang.code && currentLocale != 'en-US'"> - {{lang.englishName}}</span></option>
</select>
<small class="form-text text-muted" i18n>You need to reload the page after applying a new language.</small>
@@ -34,7 +34,7 @@
<div class="col">
<select class="form-control" formControlName="dateLocale">
- <option *ngFor="let lang of dateLocaleOptions" [ngValue]="lang.code">{{lang.name}}<span *ngIf="lang.code"> ({{today | date:'shortDate':null:lang.code}})</span></option>
+ <option *ngFor="let lang of dateLocaleOptions" [ngValue]="lang.code">{{lang.name}}<span *ngIf="lang.code"> - {{today | date:'shortDate':null:lang.code}}</span></option>
</select>
</div>
diff --git a/src-ui/src/app/components/manage/settings/settings.component.ts b/src-ui/src/app/components/manage/settings/settings.component.ts
index 5089c880f..f9a84e53b 100644
--- a/src-ui/src/app/components/manage/settings/settings.component.ts
+++ b/src-ui/src/app/components/manage/settings/settings.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, OnDestroy, Renderer2 } from '@angular/core';
+import { Component, Inject, LOCALE_ID, OnInit, Renderer2 } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { PaperlessSavedView } from 'src/app/data/paperless-saved-view';
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
@@ -44,7 +44,8 @@ export class SettingsComponent implements OnInit, OnDestroy, DirtyComponent {
public savedViewService: SavedViewService,
private documentListViewService: DocumentListViewService,
private toastService: ToastService,
- private settings: SettingsService
+ private settings: SettingsService,
+ @Inject(LOCALE_ID) public currentLocale: string
) { }
ngOnInit() {
diff --git a/src-ui/src/app/services/settings.service.ts b/src-ui/src/app/services/settings.service.ts
index d2a190c1f..041fb51ca 100644
--- a/src-ui/src/app/services/settings.service.ts
+++ b/src-ui/src/app/services/settings.service.ts
@@ -71,7 +71,7 @@ export class SettingsService {
getLanguageOptions(): LanguageOption[] {
return [
- {code: "en-us", name: $localize`English`, englishName: "English"},
+ {code: "en-US", name: $localize`English (US)`, englishName: "English (US)"},
{code: "de", name: $localize`German`, englishName: "German"},
{code: "nl", name: $localize`Dutch`, englishName: "Dutch"},
{code: "fr", name: $localize`French`, englishName: "French"}
diff --git a/src-ui/src/locale/messages.de.xlf b/src-ui/src/locale/messages.de.xlf
index 80cfefab9..a898e4630 100644
--- a/src-ui/src/locale/messages.de.xlf
+++ b/src-ui/src/locale/messages.de.xlf
@@ -449,12 +449,20 @@
<context context-type="linenumber">2</context>
</context-group>
</trans-unit>
+ <trans-unit datatype="html" id="ddb40946e790522301687ecddb9ce1cb8ad40dd1">
+ <source>Filter by:</source>
+ <target>Filtern nach:</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
<trans-unit datatype="html" id="cff1428d10d59d14e45edec3c735a27b5482db59">
<source>Name</source>
<target>Name</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">13</context>
+ <context context-type="linenumber">9</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8fa4d523f7b91df4390120b85ed0406138273e1a">
@@ -462,7 +470,7 @@
<target>Farbe</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">14</context>
+ <context context-type="linenumber">20</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="d0c4488f742efeba0915e90e285a022da813deff">
@@ -470,7 +478,7 @@
<target>Zuweisung</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">15</context>
+ <context context-type="linenumber">21</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="9bcf8d20d23c111eca1431abd2d2ce0de324499c">
@@ -478,7 +486,7 @@
<target>Anzahl Dokumente</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">16</context>
+ <context context-type="linenumber">22</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="030b4423b92167200e39519599f9b863b4f7c62c">
@@ -486,7 +494,7 @@
<target>Aktionen</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">17</context>
+ <context context-type="linenumber">23</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="9d51b3c90afda70700229d1b8a55371c13cb3bce">
@@ -494,7 +502,7 @@
<target>Dokumente</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">32</context>
+ <context context-type="linenumber">38</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="28f86ffd419b869711aa13f5e5ff54be6d70731c">
@@ -502,7 +510,7 @@
<target>Bearbeiten</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">37</context>
+ <context context-type="linenumber">43</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="4990731724078522539">
@@ -542,7 +550,7 @@
<target>Gespeicherte Ansicht &quot;<x equiv-text="savedView.name" id="PH"/>&quot; gelöscht.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">62</context>
+ <context context-type="linenumber">63</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5647210819299459618">
@@ -550,7 +558,7 @@
<target>Einstellungen erfolgreich gespeichert.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">78</context>
+ <context context-type="linenumber">79</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="6839066544204061364">
@@ -558,7 +566,7 @@
<target>Benutze Systemsprache</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">82</context>
+ <context context-type="linenumber">83</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="7729897675462249787">
@@ -566,7 +574,7 @@
<target>Benutze Datumsformat der Anzeigesprache</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">86</context>
+ <context context-type="linenumber">87</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8488620293789898901">
@@ -574,7 +582,7 @@
<target>Fehler beim Speichern der Einstellungen auf dem Server: <x equiv-text="JSON.stringify(error.error)" id="PH"/></target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">102</context>
+ <context context-type="linenumber">103</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="121cc5391cd2a5115bc2b3160379ee5b36cd7716">
@@ -814,7 +822,7 @@
<target>Letzter Kontakt</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/correspondent-list/correspondent-list.component.html</context>
- <context context-type="linenumber">15</context>
+ <context context-type="linenumber">22</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="1234709746630139322">
@@ -1114,14 +1122,6 @@
<context context-type="linenumber">46</context>
</context-group>
</trans-unit>
- <trans-unit datatype="html" id="ddb40946e790522301687ecddb9ce1cb8ad40dd1">
- <source>Filter by:</source>
- <target>Filtern nach:</target>
- <context-group purpose="location">
- <context context-type="sourcefile">src/app/components/document-list/filter-editor/filter-editor.component.html</context>
- <context context-type="linenumber">4</context>
- </context-group>
- </trans-unit>
<trans-unit datatype="html" id="02d184c288f567825a1fcbf83bcd3099a10853d5">
<source>Filter tags</source>
<target>Tags filtern</target>
@@ -1670,9 +1670,9 @@
<context context-type="linenumber">12</context>
</context-group>
</trans-unit>
- <trans-unit datatype="html" id="5866254605255506989">
- <source>English</source>
- <target>Englisch</target>
+ <trans-unit datatype="html" id="1206520795340730278">
+ <source>English (US)</source>
+ <target>Englisch (US)</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
<context context-type="linenumber">74</context>
@@ -1907,7 +1907,7 @@
<target>Automatisch</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">33</context>
+ <context context-type="linenumber">39</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5044611416737085530">
@@ -1915,7 +1915,7 @@
<target>Möchten Sie dieses Element wirklich löschen?</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">76</context>
+ <context context-type="linenumber">97</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8371896857609524947">
@@ -1923,7 +1923,7 @@
<target>Assoziierte Dokumente werden nicht gelöscht.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">83</context>
+ <context context-type="linenumber">104</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="7022070615528435141">
@@ -1931,7 +1931,7 @@
<target>Löschen</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">85</context>
+ <context context-type="linenumber">106</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5467489005440577210">
@@ -1939,7 +1939,7 @@
<target>Fehler beim Löschen des Elements: <x equiv-text="JSON.stringify(error.error)" id="PH"/></target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">93</context>
+ <context context-type="linenumber">114</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5851669019930456395">
diff --git a/src-ui/src/locale/messages.fr.xlf b/src-ui/src/locale/messages.fr.xlf
index ee97f7ce0..4f09eab72 100644
--- a/src-ui/src/locale/messages.fr.xlf
+++ b/src-ui/src/locale/messages.fr.xlf
@@ -449,12 +449,20 @@
<context context-type="linenumber">2</context>
</context-group>
</trans-unit>
+ <trans-unit datatype="html" id="ddb40946e790522301687ecddb9ce1cb8ad40dd1">
+ <source>Filter by:</source>
+ <target>Filtrer par : </target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
<trans-unit datatype="html" id="cff1428d10d59d14e45edec3c735a27b5482db59">
<source>Name</source>
<target>Nom</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">13</context>
+ <context context-type="linenumber">9</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8fa4d523f7b91df4390120b85ed0406138273e1a">
@@ -462,7 +470,7 @@
<target>Couleur</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">14</context>
+ <context context-type="linenumber">20</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="d0c4488f742efeba0915e90e285a022da813deff">
@@ -470,7 +478,7 @@
<target>Rapprochement</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">15</context>
+ <context context-type="linenumber">21</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="9bcf8d20d23c111eca1431abd2d2ce0de324499c">
@@ -478,7 +486,7 @@
<target>Nombre de documents</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">16</context>
+ <context context-type="linenumber">22</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="030b4423b92167200e39519599f9b863b4f7c62c">
@@ -486,7 +494,7 @@
<target>Actions</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">17</context>
+ <context context-type="linenumber">23</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="9d51b3c90afda70700229d1b8a55371c13cb3bce">
@@ -494,7 +502,7 @@
<target>Documents</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">32</context>
+ <context context-type="linenumber">38</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="28f86ffd419b869711aa13f5e5ff54be6d70731c">
@@ -502,7 +510,7 @@
<target>Éditer</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">37</context>
+ <context context-type="linenumber">43</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="4990731724078522539">
@@ -542,7 +550,7 @@
<target>Vue &quot;<x equiv-text="savedView.name" id="PH"/>&quot; supprimée.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">62</context>
+ <context context-type="linenumber">63</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5647210819299459618">
@@ -550,7 +558,7 @@
<target>Paramètres enregistrés avec succès.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">78</context>
+ <context context-type="linenumber">79</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="6839066544204061364">
@@ -558,7 +566,7 @@
<target>Utiliser la langue du système</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">82</context>
+ <context context-type="linenumber">83</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="7729897675462249787">
@@ -566,7 +574,7 @@
<target>Utiliser le format de date de la langue d'affichage</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">86</context>
+ <context context-type="linenumber">87</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8488620293789898901">
@@ -574,7 +582,7 @@
<target>Une erreur s'est produite lors de l'enregistrement des paramètres sur le serveur : <x equiv-text="JSON.stringify(error.error)" id="PH"/></target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">102</context>
+ <context context-type="linenumber">103</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="121cc5391cd2a5115bc2b3160379ee5b36cd7716">
@@ -814,7 +822,7 @@
<target>Dernière correspondance</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/correspondent-list/correspondent-list.component.html</context>
- <context context-type="linenumber">15</context>
+ <context context-type="linenumber">22</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="1234709746630139322">
@@ -1114,14 +1122,6 @@
<context context-type="linenumber">46</context>
</context-group>
</trans-unit>
- <trans-unit datatype="html" id="ddb40946e790522301687ecddb9ce1cb8ad40dd1">
- <source>Filter by:</source>
- <target>Filtrer par : </target>
- <context-group purpose="location">
- <context context-type="sourcefile">src/app/components/document-list/filter-editor/filter-editor.component.html</context>
- <context context-type="linenumber">4</context>
- </context-group>
- </trans-unit>
<trans-unit datatype="html" id="02d184c288f567825a1fcbf83bcd3099a10853d5">
<source>Filter tags</source>
<target>Filtrer les étiquettes</target>
@@ -1670,9 +1670,9 @@
<context context-type="linenumber">12</context>
</context-group>
</trans-unit>
- <trans-unit datatype="html" id="5866254605255506989">
- <source>English</source>
- <target>Anglais</target>
+ <trans-unit datatype="html" id="1206520795340730278">
+ <source>English (US)</source>
+ <target>Anglais (US)</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
<context context-type="linenumber">74</context>
@@ -1907,7 +1907,7 @@
<target>Automatique</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">33</context>
+ <context context-type="linenumber">39</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5044611416737085530">
@@ -1915,7 +1915,7 @@
<target>Voulez-vous vraiment supprimer cet élément ?</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">76</context>
+ <context context-type="linenumber">97</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8371896857609524947">
@@ -1923,7 +1923,7 @@
<target>Les documents associés ne seront pas supprimés.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">83</context>
+ <context context-type="linenumber">104</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="7022070615528435141">
@@ -1931,7 +1931,7 @@
<target>Supprimer</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">85</context>
+ <context context-type="linenumber">106</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5467489005440577210">
@@ -1939,7 +1939,7 @@
<target>Une erreur s'est produite lors de la suppression de l'élément : <x equiv-text="JSON.stringify(error.error)" id="PH"/></target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">93</context>
+ <context context-type="linenumber">114</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5851669019930456395">
diff --git a/src-ui/src/locale/messages.nl_NL.xlf b/src-ui/src/locale/messages.nl_NL.xlf
index 39545c0e2..3753bc92c 100644
--- a/src-ui/src/locale/messages.nl_NL.xlf
+++ b/src-ui/src/locale/messages.nl_NL.xlf
@@ -449,12 +449,20 @@
<context context-type="linenumber">2</context>
</context-group>
</trans-unit>
+ <trans-unit datatype="html" id="ddb40946e790522301687ecddb9ce1cb8ad40dd1">
+ <source>Filter by:</source>
+ <target>Filter op:</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
<trans-unit datatype="html" id="cff1428d10d59d14e45edec3c735a27b5482db59">
<source>Name</source>
<target>Naam</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">13</context>
+ <context context-type="linenumber">9</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8fa4d523f7b91df4390120b85ed0406138273e1a">
@@ -462,7 +470,7 @@
<target>Kleur</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">14</context>
+ <context context-type="linenumber">20</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="d0c4488f742efeba0915e90e285a022da813deff">
@@ -470,7 +478,7 @@
<target>Overeenkomend</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">15</context>
+ <context context-type="linenumber">21</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="9bcf8d20d23c111eca1431abd2d2ce0de324499c">
@@ -478,7 +486,7 @@
<target>Aantal documenten</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">16</context>
+ <context context-type="linenumber">22</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="030b4423b92167200e39519599f9b863b4f7c62c">
@@ -486,7 +494,7 @@
<target>Acties</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">17</context>
+ <context context-type="linenumber">23</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="9d51b3c90afda70700229d1b8a55371c13cb3bce">
@@ -494,7 +502,7 @@
<target>Documenten</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">32</context>
+ <context context-type="linenumber">38</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="28f86ffd419b869711aa13f5e5ff54be6d70731c">
@@ -502,7 +510,7 @@
<target>Bewerk</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/tag-list/tag-list.component.html</context>
- <context context-type="linenumber">37</context>
+ <context context-type="linenumber">43</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="4990731724078522539">
@@ -542,7 +550,7 @@
<target>Opgeslagen view &quot;<x equiv-text="savedView.name" id="PH"/>&quot; verwijderd.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">62</context>
+ <context context-type="linenumber">63</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5647210819299459618">
@@ -550,7 +558,7 @@
<target>Instellingen succesvol opgeslagen.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">78</context>
+ <context context-type="linenumber">79</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="6839066544204061364">
@@ -558,7 +566,7 @@
<target>Gebruik de systeemtaal</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">82</context>
+ <context context-type="linenumber">83</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="7729897675462249787">
@@ -566,7 +574,7 @@
<target>Datumopmaak van weergavetaal gebruiken</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">86</context>
+ <context context-type="linenumber">87</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8488620293789898901">
@@ -574,7 +582,7 @@
<target>Fout bij het opslaan van de instellingen: <x equiv-text="JSON.stringify(error.error)" id="PH"/></target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.ts</context>
- <context context-type="linenumber">102</context>
+ <context context-type="linenumber">103</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="121cc5391cd2a5115bc2b3160379ee5b36cd7716">
@@ -814,7 +822,7 @@
<target>Laatste correspondentie</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/correspondent-list/correspondent-list.component.html</context>
- <context context-type="linenumber">15</context>
+ <context context-type="linenumber">22</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="1234709746630139322">
@@ -1114,14 +1122,6 @@
<context context-type="linenumber">46</context>
</context-group>
</trans-unit>
- <trans-unit datatype="html" id="ddb40946e790522301687ecddb9ce1cb8ad40dd1">
- <source>Filter by:</source>
- <target>Filter op:</target>
- <context-group purpose="location">
- <context context-type="sourcefile">src/app/components/document-list/filter-editor/filter-editor.component.html</context>
- <context context-type="linenumber">4</context>
- </context-group>
- </trans-unit>
<trans-unit datatype="html" id="02d184c288f567825a1fcbf83bcd3099a10853d5">
<source>Filter tags</source>
<target>Etiketten filteren</target>
@@ -1670,9 +1670,9 @@
<context context-type="linenumber">12</context>
</context-group>
</trans-unit>
- <trans-unit datatype="html" id="5866254605255506989">
- <source>English</source>
- <target>Engels</target>
+ <trans-unit datatype="html" id="1206520795340730278">
+ <source>English (US)</source>
+ <target>Engels (US)</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
<context context-type="linenumber">74</context>
@@ -1907,7 +1907,7 @@
<target>Automatisch</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">33</context>
+ <context context-type="linenumber">39</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5044611416737085530">
@@ -1915,7 +1915,7 @@
<target>Wil je dit element echt verwijderen?</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">76</context>
+ <context context-type="linenumber">97</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="8371896857609524947">
@@ -1923,7 +1923,7 @@
<target>Geassocieerde documenten zullen niet verwijderd worden.</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">83</context>
+ <context context-type="linenumber">104</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="7022070615528435141">
@@ -1931,7 +1931,7 @@
<target>Verwijderen</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">85</context>
+ <context context-type="linenumber">106</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5467489005440577210">
@@ -1939,7 +1939,7 @@
<target>Fout bij het verwijderen van het element: <x equiv-text="JSON.stringify(error.error)" id="PH"/></target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/generic-list/generic-list.component.ts</context>
- <context context-type="linenumber">93</context>
+ <context context-type="linenumber">114</context>
</context-group>
</trans-unit>
<trans-unit datatype="html" id="5851669019930456395">
diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.py
index 595bd39cd..9ba1b1a87 100644
--- a/src/documents/management/commands/document_consumer.py
+++ b/src/documents/management/commands/document_consumer.py
@@ -70,31 +70,6 @@ def _consume(filepath):
"Error while consuming document: {}".format(e))
-def _test_inotify(directory):
- if not INotify:
- return False
-
- test_file = os.path.join(directory, "__inotify_test_file__")
- inotify = INotify()
- descriptor = None
- try:
- inotify_flags = flags.CLOSE_WRITE | flags.MOVED_TO
- descriptor = inotify.add_watch(directory, inotify_flags)
- Path(test_file).touch()
- events = inotify.read(timeout=1000)
- return len(events) == 1
- except Exception as e:
- logger.warning(
- f"Error while checking inotify availability: {str(e)}")
- return False
- finally:
- if descriptor:
- inotify.rm_watch(descriptor)
- inotify.close()
- if os.path.isfile(test_file):
- os.unlink(test_file)
-
-
def _consume_wait_unmodified(file, num_tries=20, wait_time=1):
mtime = -1
current_try = 0
@@ -178,25 +153,17 @@ class Command(BaseCommand):
if options["oneshot"]:
return
- if settings.CONSUMER_POLLING == 0:
- if _test_inotify(directory):
- self.handle_inotify(directory, recursive)
- else:
- logger.warning(
- f"Inotify notifications are not available on {directory}, "
- f"falling back to polling every 10 seconds")
- self.handle_polling(
- directory, recursive, 10)
+ if settings.CONSUMER_POLLING == 0 and INotify:
+ self.handle_inotify(directory, recursive)
else:
- self.handle_polling(
- directory, recursive, settings.CONSUMER_POLLING)
+ self.handle_polling(directory, recursive)
logger.debug("Consumer exiting.")
- def handle_polling(self, directory, recursive, timeout):
+ def handle_polling(self, directory, recursive):
logging.getLogger(__name__).info(
f"Polling directory for changes: {directory}")
- self.observer = PollingObserver(timeout=timeout)
+ self.observer = PollingObserver(timeout=settings.CONSUMER_POLLING)
self.observer.schedule(Handler(), directory, recursive=recursive)
self.observer.start()
try:
diff --git a/src/documents/models.py b/src/documents/models.py
index 928b8aa4d..86878dd7e 100755
--- a/src/documents/models.py
+++ b/src/documents/models.py
@@ -63,12 +63,6 @@ class MatchingModel(models.Model):
def __str__(self):
return self.name
- def save(self, *args, **kwargs):
-
- self.match = self.match.lower()
-
- models.Model.save(self, *args, **kwargs)
-
class Correspondent(MatchingModel):
diff --git a/src/documents/tests/test_api.py b/src/documents/tests/test_api.py
index 5f81b83b6..2b332a873 100644
--- a/src/documents/tests/test_api.py
+++ b/src/documents/tests/test_api.py
@@ -228,6 +228,12 @@ class TestDocumentApi(DirectoriesMixin, APITestCase):
self.assertEqual(len(results), 2)
self.assertCountEqual([results[0]['id'], results[1]['id']], [doc1.id, doc3.id])
+ response = self.client.get("/api/documents/?tags__id__in={},{}".format(tag_2.id, tag_3.id))
+ self.assertEqual(response.status_code, 200)
+ results = response.data['results']
+ self.assertEqual(len(results), 2)
+ self.assertCountEqual([results[0]['id'], results[1]['id']], [doc2.id, doc3.id])
+
response = self.client.get("/api/documents/?tags__id__all={},{}".format(tag_2.id, tag_3.id))
self.assertEqual(response.status_code, 200)
results = response.data['results']
@@ -923,6 +929,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):
doc2 = Document.objects.get(id=self.doc2.id)
self.assertEqual(doc2.correspondent, self.c1)
+ def test_api_no_correspondent(self):
+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({
+ "documents": [self.doc2.id],
+ "method": "set_correspondent",
+ "parameters": {}
+ }), content_type='application/json')
+ self.assertEqual(response.status_code, 400)
+
def test_api_invalid_document_type(self):
self.assertEqual(self.doc2.document_type, self.dt1)
response = self.client.post("/api/documents/bulk_edit/", json.dumps({
@@ -935,6 +949,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):
doc2 = Document.objects.get(id=self.doc2.id)
self.assertEqual(doc2.document_type, self.dt1)
+ def test_api_no_document_type(self):
+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({
+ "documents": [self.doc2.id],
+ "method": "set_document_type",
+ "parameters": {}
+ }), content_type='application/json')
+ self.assertEqual(response.status_code, 400)
+
def test_api_add_invalid_tag(self):
self.assertEqual(list(self.doc2.tags.all()), [self.t1])
response = self.client.post("/api/documents/bulk_edit/", json.dumps({
@@ -946,6 +968,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):
self.assertEqual(list(self.doc2.tags.all()), [self.t1])
+ def test_api_add_tag_no_tag(self):
+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({
+ "documents": [self.doc2.id],
+ "method": "add_tag",
+ "parameters": {}
+ }), content_type='application/json')
+ self.assertEqual(response.status_code, 400)
+
def test_api_delete_invalid_tag(self):
self.assertEqual(list(self.doc2.tags.all()), [self.t1])
response = self.client.post("/api/documents/bulk_edit/", json.dumps({
@@ -957,6 +987,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):
self.assertEqual(list(self.doc2.tags.all()), [self.t1])
+ def test_api_delete_tag_no_tag(self):
+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({
+ "documents": [self.doc2.id],
+ "method": "remove_tag",
+ "parameters": {}
+ }), content_type='application/json')
+ self.assertEqual(response.status_code, 400)
+
def test_api_modify_invalid_tags(self):
self.assertEqual(list(self.doc2.tags.all()), [self.t1])
response = self.client.post("/api/documents/bulk_edit/", json.dumps({
@@ -966,6 +1004,21 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):
}), content_type='application/json')
self.assertEqual(response.status_code, 400)
+ def test_api_modify_tags_no_tags(self):
+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({
+ "documents": [self.doc2.id],
+ "method": "modify_tags",
+ "parameters": {"remove_tags": [1123123]}
+ }), content_type='application/json')
+ self.assertEqual(response.status_code, 400)
+
+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({
+ "documents": [self.doc2.id],
+ "method": "modify_tags",
+ "parameters": {'add_tags': [self.t2.id, 1657]}
+ }), content_type='application/json')
+ self.assertEqual(response.status_code, 400)
+
def test_api_selection_data_empty(self):
response = self.client.post("/api/documents/selection_data/", json.dumps({
"documents": []
diff --git a/src/documents/tests/test_management_consumer.py b/src/documents/tests/test_management_consumer.py
index 0680e7f56..b6a61a167 100644
--- a/src/documents/tests/test_management_consumer.py
+++ b/src/documents/tests/test_management_consumer.py
@@ -7,9 +7,8 @@ from unittest import mock
from django.conf import settings
from django.core.management import call_command, CommandError
-from django.test import override_settings, TransactionTestCase, TestCase
+from django.test import override_settings, TransactionTestCase
-from documents.management.commands.document_consumer import _test_inotify
from documents.models import Tag
from documents.consumer import ConsumerError
from documents.management.commands import document_consumer
@@ -261,27 +260,3 @@ class TestConsumerTags(DirectoriesMixin, ConsumerMixin, TransactionTestCase):
@override_settings(CONSUMER_POLLING=1)
def test_consume_file_with_path_tags_polling(self):
self.test_consume_file_with_path_tags()
-
-
-class TestInotify(DirectoriesMixin, TestCase):
-
- def test_inotify(self):
- self.assertTrue(_test_inotify(self.dirs.consumption_dir))
-
- @mock.patch("documents.management.commands.document_consumer.Path.touch")
- def test_inotify_error(self, m):
- m.side_effect = OSError("Permission error")
- self.assertFalse(_test_inotify(self.dirs.consumption_dir))
-
- @mock.patch("documents.management.commands.document_consumer.Command.handle_polling")
- @mock.patch("documents.management.commands.document_consumer.Command.handle_inotify")
- @mock.patch("documents.management.commands.document_consumer._test_inotify")
- def test_polling_fallback(self, test_inotify, handle_inotify, handle_polling):
- test_inotify.return_value = False
-
- cmd = document_consumer.Command()
- cmd.handle(directory=settings.CONSUMPTION_DIR, oneshot=False)
-
- test_inotify.assert_called_once()
- handle_polling.assert_called_once()
- handle_inotify.assert_not_called()
diff --git a/src/documents/tests/test_parsers.py b/src/documents/tests/test_parsers.py
index 805e4beac..392c0504f 100644
--- a/src/documents/tests/test_parsers.py
+++ b/src/documents/tests/test_parsers.py
@@ -120,3 +120,4 @@ class TestParserAvailability(TestCase):
self.assertTrue(is_file_ext_supported('.pdf'))
self.assertFalse(is_file_ext_supported('.hsdfh'))
+ self.assertFalse(is_file_ext_supported(''))
diff --git a/src/documents/views.py b/src/documents/views.py
index eb9078f75..b99bf11c7 100755
--- a/src/documents/views.py
+++ b/src/documents/views.py
@@ -159,6 +159,9 @@ class DocumentViewSet(RetrieveModelMixin,
"added",
"archive_serial_number")
+ def get_queryset(self):
+ return Document.objects.distinct()
+
def get_serializer(self, *args, **kwargs):
fields_param = self.request.query_params.get('fields', None)
if fields_param: