wbwriter 1.55.9__tar.gz → 1.55.10rc0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wbwriter might be problematic. Click here for more details.
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/PKG-INFO +1 -1
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/article.py +4 -4
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/article_type.py +1 -1
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/in_editor_template.py +1 -1
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/meta_information.py +2 -2
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/publication_models.py +4 -1
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/pdf_generator.py +2 -2
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/publication_parser.py +3 -4
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/serializers/article.py +1 -3
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/tests/signals.py +1 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/tests/test_filter.py +1 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/tests/test_model.py +1 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/tests/test_writer.py +1 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/.gitignore +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/pyproject.toml +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/admin.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/apps.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/dynamic_preferences_registry.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/factories/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/factories/article.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/factories/meta_information.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/filters/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/filters/article.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/filters/metainformationinstance.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/locale/de/LC_MESSAGES/django.mo +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/locale/de/LC_MESSAGES/django.po +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/locale/en/LC_MESSAGES/django.mo +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/locale/en/LC_MESSAGES/django.po +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/locale/fr/LC_MESSAGES/django.mo +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/locale/fr/LC_MESSAGES/django.po +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/migrations/0001_initial_squashed_squashed_0008_alter_article_author_alter_article_feedback_contact_and_more.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/migrations/0009_dependantarticle.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/migrations/0010_alter_article_options.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/migrations/0011_auto_20240103_0953.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/migrations/0012_i18n.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/migrations/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/block.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/block_parameter.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/mixins.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/style.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/models/template.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/serializers/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/serializers/article_type.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/serializers/in_editor_template.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/serializers/meta_information.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/serializers/publication.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/templates/wbwriter/article_pdf.html +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/templates/wbwriter/templatetags/cite_article.html +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/templates/wbwriter/templatetags/table_of_contents.html +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/templates/wbwriter/templatetags/table_of_contents_articles.html +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/templatetags/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/templatetags/writer.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/tests/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/tests/conftest.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/tests/tests.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/typings.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/urls.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/article.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/article_type.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/buttons.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/article.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/article_type.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/in_editor_template.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/meta_information.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/meta_information_instance.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/publication.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/documentation/article.md +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/endpoints/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/endpoints/article.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/endpoints/meta_information.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/in_editor_template.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/menu.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/meta_information.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/meta_information_instance.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/publication.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/titles/__init__.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/titles/publication_title_config.py +0 -0
- {wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/titles/reviewer_article_title_config.py +0 -0
|
@@ -39,7 +39,7 @@ from weasyprint import CSS
|
|
|
39
39
|
|
|
40
40
|
from wbwriter.models.publication_models import Publication
|
|
41
41
|
from wbwriter.pdf_generator import PdfGenerator
|
|
42
|
-
from wbwriter.publication_parser import
|
|
42
|
+
from wbwriter.publication_parser import ParserValidationError
|
|
43
43
|
from wbwriter.typings import ArticleDTO
|
|
44
44
|
|
|
45
45
|
from .mixins import PublishableMixin
|
|
@@ -167,7 +167,7 @@ class DependantArticle(WBModel):
|
|
|
167
167
|
)
|
|
168
168
|
|
|
169
169
|
@classmethod
|
|
170
|
-
def get_endpoint_basename(
|
|
170
|
+
def get_endpoint_basename(cls):
|
|
171
171
|
return "wbwriter:dependantarticle"
|
|
172
172
|
|
|
173
173
|
@classmethod
|
|
@@ -789,7 +789,7 @@ class Article(CloneMixin, TagModelMixin, PublishableMixin, WBModel):
|
|
|
789
789
|
self._build_dto(),
|
|
790
790
|
date.today(),
|
|
791
791
|
).is_valid()
|
|
792
|
-
except
|
|
792
|
+
except ParserValidationError as e:
|
|
793
793
|
errors["non_field_errors"] = e.errors
|
|
794
794
|
except ModuleNotFoundError:
|
|
795
795
|
errors["non_field_errors"] = [gettext_lazy("invalid parser")]
|
|
@@ -1175,7 +1175,7 @@ class Article(CloneMixin, TagModelMixin, PublishableMixin, WBModel):
|
|
|
1175
1175
|
return mapping
|
|
1176
1176
|
|
|
1177
1177
|
@classmethod
|
|
1178
|
-
def get_endpoint_basename(
|
|
1178
|
+
def get_endpoint_basename(cls):
|
|
1179
1179
|
return "wbwriter:article"
|
|
1180
1180
|
|
|
1181
1181
|
@classmethod
|
|
@@ -32,7 +32,7 @@ class ArticleType(WBModel):
|
|
|
32
32
|
qa_reviewers = models.ManyToManyField("directory.Person", related_name="article_type_qa_reviewers")
|
|
33
33
|
|
|
34
34
|
@classmethod
|
|
35
|
-
def get_endpoint_basename(
|
|
35
|
+
def get_endpoint_basename(cls):
|
|
36
36
|
return "wbwriter:articletyperepresentation"
|
|
37
37
|
|
|
38
38
|
@classmethod
|
|
@@ -24,7 +24,7 @@ class MetaInformation(WBModel):
|
|
|
24
24
|
verbose_name_plural = "Meta Information"
|
|
25
25
|
|
|
26
26
|
@classmethod
|
|
27
|
-
def get_endpoint_basename(
|
|
27
|
+
def get_endpoint_basename(cls):
|
|
28
28
|
return "wbwriter:metainformation"
|
|
29
29
|
|
|
30
30
|
@classmethod
|
|
@@ -60,7 +60,7 @@ class MetaInformationInstance(WBModel):
|
|
|
60
60
|
]
|
|
61
61
|
|
|
62
62
|
@classmethod
|
|
63
|
-
def get_endpoint_basename(
|
|
63
|
+
def get_endpoint_basename(cls):
|
|
64
64
|
return "wbwriter:metainformationinstance"
|
|
65
65
|
|
|
66
66
|
@classmethod
|
|
@@ -77,6 +77,9 @@ class Publication(TagModelMixin, models.Model):
|
|
|
77
77
|
object_id = models.PositiveIntegerField()
|
|
78
78
|
content_object = GenericForeignKey("content_type", "object_id")
|
|
79
79
|
|
|
80
|
+
def __str__(self) -> str:
|
|
81
|
+
return self.title
|
|
82
|
+
|
|
80
83
|
@classmethod
|
|
81
84
|
def create_or_update_from_parser_and_object(cls, parser, generic_object):
|
|
82
85
|
if hasattr(generic_object, "_build_dto") and callable(generic_object._build_dto):
|
|
@@ -91,7 +94,7 @@ class Publication(TagModelMixin, models.Model):
|
|
|
91
94
|
pub.save()
|
|
92
95
|
|
|
93
96
|
@classmethod
|
|
94
|
-
def get_endpoint_basename(
|
|
97
|
+
def get_endpoint_basename(cls):
|
|
95
98
|
return "wbwriter:publication"
|
|
96
99
|
|
|
97
100
|
@classmethod
|
|
@@ -31,7 +31,7 @@ class PdfGenerator:
|
|
|
31
31
|
main_html,
|
|
32
32
|
header_html=None,
|
|
33
33
|
footer_html=None,
|
|
34
|
-
custom_css=
|
|
34
|
+
custom_css=None,
|
|
35
35
|
base_url=None,
|
|
36
36
|
side_margin=2,
|
|
37
37
|
extra_vertical_margin=30,
|
|
@@ -61,7 +61,7 @@ class PdfGenerator:
|
|
|
61
61
|
self.main_html = main_html
|
|
62
62
|
self.header_html = header_html
|
|
63
63
|
self.footer_html = footer_html
|
|
64
|
-
self.custom_css = custom_css
|
|
64
|
+
self.custom_css = custom_css if custom_css else []
|
|
65
65
|
self.base_url = base_url
|
|
66
66
|
self.side_margin = side_margin
|
|
67
67
|
self.extra_vertical_margin = extra_vertical_margin
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os
|
|
3
|
-
from abc import ABC
|
|
4
3
|
from datetime import date
|
|
5
4
|
from io import BytesIO
|
|
6
5
|
from typing import Iterable
|
|
@@ -17,12 +16,12 @@ from wbwriter.pdf_generator import PdfGenerator
|
|
|
17
16
|
from .typings import ArticleDTO
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
class
|
|
19
|
+
class ParserValidationError(Exception):
|
|
21
20
|
def __init__(self, *args, errors=None, **kwargs): # real signature unknown
|
|
22
21
|
self.errors = errors
|
|
23
22
|
|
|
24
23
|
|
|
25
|
-
class PublicationParser
|
|
24
|
+
class PublicationParser: # pragma: no cover
|
|
26
25
|
def __init__(self, article: ArticleDTO, published_date: date):
|
|
27
26
|
self.article = article
|
|
28
27
|
self.published_date = published_date
|
|
@@ -64,7 +63,7 @@ class PublicationParser(ABC): # pragma: no cover
|
|
|
64
63
|
self._errors = []
|
|
65
64
|
is_valid = self._is_valid()
|
|
66
65
|
if self.errors and raise_exception:
|
|
67
|
-
raise
|
|
66
|
+
raise ParserValidationError(errors=self.errors)
|
|
68
67
|
return is_valid
|
|
69
68
|
|
|
70
69
|
def _get_additional_information(self) -> dict[str, any]:
|
|
@@ -7,6 +7,7 @@ from wbcore.contrib.directory.serializers import (
|
|
|
7
7
|
InternalUserProfileRepresentationSerializer,
|
|
8
8
|
)
|
|
9
9
|
from wbcore.contrib.documents.models import Document
|
|
10
|
+
from wbcore.contrib.i18n.serializers.mixins import ModelTranslateSerializerMixin
|
|
10
11
|
from wbcore.contrib.tags.serializers import TagSerializerMixin
|
|
11
12
|
from wbcore.serializers import (
|
|
12
13
|
HyperlinkField,
|
|
@@ -58,9 +59,6 @@ class DependantArticleModelSerializer(ModelSerializer):
|
|
|
58
59
|
)
|
|
59
60
|
|
|
60
61
|
|
|
61
|
-
from wbcore.contrib.i18n.serializers.mixins import ModelTranslateSerializerMixin
|
|
62
|
-
|
|
63
|
-
|
|
64
62
|
class ArticleModelSerializer(ModelTranslateSerializerMixin, TagSerializerMixin, ModelSerializer):
|
|
65
63
|
"""Serializes a subset of the fields of of the Article model to minimize
|
|
66
64
|
workload on serializing lists of instances.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from django.dispatch import receiver
|
|
2
2
|
from dynamic_preferences.registries import global_preferences_registry
|
|
3
3
|
from wbcore.test.signals import custom_update_kwargs
|
|
4
|
+
|
|
4
5
|
from wbwriter.models import Article
|
|
5
6
|
from wbwriter.viewsets import ArticleModelViewSet, ReviewerArticleModelViewSet
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
from rest_framework.test import APIRequestFactory
|
|
3
3
|
from wbcore.contrib.authentication.factories import InternalUserFactory
|
|
4
|
+
|
|
4
5
|
from wbwriter.factories import ArticleFactory, MetaInformationInstanceFactory
|
|
5
6
|
from wbwriter.filters import MetaInformationInstanceFilter
|
|
6
7
|
from wbwriter.models import MetaInformationInstance
|
|
@@ -5,6 +5,7 @@ from django.forms.models import model_to_dict
|
|
|
5
5
|
from django_fsm import has_transition_perm
|
|
6
6
|
from wbcore.contrib.authentication.factories import UserFactory
|
|
7
7
|
from wbcore.contrib.authentication.models import Permission, User
|
|
8
|
+
|
|
8
9
|
from wbwriter.factories import (
|
|
9
10
|
ArticleFactory,
|
|
10
11
|
ArticleTypeFactory,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/templates/wbwriter/templatetags/cite_article.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/display/meta_information_instance.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/titles/publication_title_config.py
RENAMED
|
File without changes
|
{wbwriter-1.55.9 → wbwriter-1.55.10rc0}/wbwriter/viewsets/titles/reviewer_article_title_config.py
RENAMED
|
File without changes
|