Skip to content

Commit

Permalink
Merge pull request #526 from digitalfabrik/develop
Browse files Browse the repository at this point in the history
Release `2024.5.0`
  • Loading branch information
MizukiTemma authored May 13, 2024
2 parents 7f9640a + c85333c commit 29ab438
Show file tree
Hide file tree
Showing 95 changed files with 3,691 additions and 3,169 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ jobs:
paths:
- lunes_cms/locale/de/LC_MESSAGES/django.mo
- lunes_cms/locale/de/LC_MESSAGES/djangojs.mo
pylint:
docker:
- image: "cimg/python:3.9"
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Run pylint
command: ./tools/pylint.sh
setup-test-reporter:
docker:
- image: cimg/base:stable
Expand Down Expand Up @@ -355,6 +365,9 @@ workflows:
filters:
branches:
ignore: main
- pylint:
requires:
- install
- test:
requires:
- compile-translations
Expand Down
3 changes: 2 additions & 1 deletion .circleci/scripts/create_release.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3

import os
import argparse
import mimetypes
import os

import requests


Expand Down
4 changes: 2 additions & 2 deletions .circleci/scripts/get_access_token.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python3

import os
from base64 import b64decode
from datetime import datetime, timedelta

import os
import requests
import jwt
import requests


def main():
Expand Down
94 changes: 10 additions & 84 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,87 +1,13 @@
[MASTER]

disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
missing-module-docstring,
disable=missing-module-docstring,
invalid-name,
fixme,
similarities,
format,
no-member
no-member,
line-too-long,
unused-argument,
too-few-public-methods,
too-many-ancestors,
duplicate-code,
consider-using-with

enable = useless-suppression
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
UNRELEASED
----------

* [ [#267](https://github.com/digitalfabrik/lunes-cms/issues/267) ] Add professions in the vocabulary list
* [ [#497](https://github.com/digitalfabrik/lunes-cms/issues/497) ] Mark words that have an image with icon in training sets view
* [ [#477](https://github.com/digitalfabrik/lunes-cms/issues/477) ] Add definition field
* [ [#516](https://github.com/digitalfabrik/lunes-cms/issues/516) ] Add fields for plural of alternative words and plural article
* [ [#352](https://github.com/digitalfabrik/lunes-cms/issues/352) ] Highlight unread feedback entries in list
* [ [#436](https://github.com/digitalfabrik/lunes-cms/issues/436) ] Add fields for grammatical gender


2023.7.0
--------
Expand Down
27 changes: 0 additions & 27 deletions LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -175,29 +174,3 @@
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

25 changes: 25 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[Lunes CMS](https://github.com/digitalfabrik/lunes-cms)
Copyright © 2020 [Tür an Tür - Digitalfabrik gGmbH](https://github.com/digitalfabrik) and [individual contributors](https://github.com/digitalfabrik/lunes-cms/graphs/contributors).
All rights reserved.

_________________

This repository includes code from:

[Integreat CMS](https://github.com/digitalfabrik/integreat-cms)
Copyright © 2018 [Tür an Tür - Digitalfabrik gGmbH](https://github.com/digitalfabrik) and [individual contributors](https://github.com/digitalfabrik/integreat-cms/graphs/contributors).
All rights reserved.

_________________

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
![Coverage](https://img.shields.io/codeclimate/coverage/digitalfabrik/lunes-cms)
[![Documentation Status](https://readthedocs.org/projects/lunes-cms/badge/?version=latest)](https://lunes-cms.readthedocs.io/en/latest/?badge=latest)
[![PyPi](https://img.shields.io/pypi/v/lunes-cms.svg)](https://pypi.org/project/lunes-cms/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Pylint](https://img.shields.io/badge/pylint-10.00-brightgreen)](https://www.pylint.org/)

# Lunes CMS
[![Logo](.github/logo.png) Lunes - Vocabulary for your profession.](https://www.lunes.app)
Expand Down Expand Up @@ -59,3 +60,10 @@ For detailed instructions and the source code reference have a look at our docum
The API usage documentation is available here:

### <p align="center">:iphone: https://lunes.tuerantuer.org/api/docs/</p>

## License

Copyright © 2020 [Tür an Tür - Digitalfabrik gGmbH](https://github.com/digitalfabrik) and [individual contributors](https://github.com/digitalfabrik/lunes-cms/graphs/contributors).
All rights reserved.

This project is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](./LICENSE) and [NOTICE.md](./NOTICE.md).
10 changes: 8 additions & 2 deletions docs/src/code-style-guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ We use the `black <https://github.com/psf/black>`_ coding style, a flavour of `P
We use a `pre-commit-hook <https://pre-commit.com/>`_ to apply this style before committing, so you don't have to bother about formatting.
Just code how you feel comfortable and let the tool do the work for you (see :ref:`pre-commit-hooks`).

Run black manually by starting the virtual environment and then:
If you want to apply the formatting without committing, use our developer tool :github-source:`tools/black.sh`::

black .
./tools/black.sh


.. _pylint:

Linting
-------

In addition to black, we use pylint to check the code for semantic correctness.
Run pylint with our developer tool :github-source:`tools/pylint.sh`::

./tools/pylint.sh

When you think a warning is a false positive, add a comment before the specific line::

Expand Down
7 changes: 3 additions & 4 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@

# -- Path setup --------------------------------------------------------------

import importlib
import inspect

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import inspect
import importlib

from datetime import date

from django import VERSION as django_version


# Append project source directory to path environment variable
sys.path.append(os.path.abspath(".."))
# Append sphinx source directory to path environment variable to allow documentation for this file
Expand Down
5 changes: 5 additions & 0 deletions docs/src/continous-integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ black

This job executes ``black --check .``, which checks whether the code matches the :ref:`black-code-style` code style.

pylint
------

This job executes ``pylint_runner``, which checks whether the :ref:`pylint` throws any errors or warnings.

shellcheck/check
----------------

Expand Down
1 change: 1 addition & 0 deletions lunes_cms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Documentation Status](https://readthedocs.org/projects/lunes-cms/badge/?version=latest)](https://lunes-cms.readthedocs.io/en/latest/?badge=latest)
[![License](https://img.shields.io/github/license/digitalfabrik/lunes-cms)](https://opensource.org/licenses/Apache-2.0)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Pylint](https://img.shields.io/badge/pylint-10.00-brightgreen)](https://www.pylint.org/)

# Lunes CMS

Expand Down
10 changes: 4 additions & 6 deletions lunes_cms/api/permissions.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.utils.timezone import now

from rest_framework import permissions

from ..cms.models import GroupAPIKey
from .utils import get_key


class VerifyGroupKey(permissions.AllowAny):
"""Simple permissions class that blocks
"""
Simple permissions class that blocks
requests if no valid API-Token is delivered.
Inherits from `permissions.AllowAny`.
"""

def has_permission(self, request, view):
"""Checks whether a valid API-Key is send
"""
Checks whether a valid API-Key is send
by the user in the authorization header
:param request: http request
Expand Down
1 change: 0 additions & 1 deletion lunes_cms/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
from django.urls import include, path


#: The namespace for this URL config (see :attr:`django.urls.ResolverMatch.app_name`)
app_name = "api"

Expand Down
3 changes: 1 addition & 2 deletions lunes_cms/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from django.core.exceptions import PermissionDenied
from django.db.models import Count, Q

from rest_framework import routers

from ..cms.models import Discipline, GroupAPIKey
Expand Down Expand Up @@ -38,7 +37,7 @@ def get_key(request, keyword="Api-Key"):
if not authorization:
return None
try:
_, key = authorization.split("{} ".format(keyword))
_, key = authorization.split(f"{keyword} ")
except ValueError:
key = None
return key
Expand Down
2 changes: 1 addition & 1 deletion lunes_cms/api/v1/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
from .document_serializer import DocumentSerializer
from .feedback_serializer import FeedbackSerializer
from .group_serializer import GroupSerializer
from .training_set_serializer import TrainingSetSerializer
from .sponsor_serializer import SponsorSerializer
from .training_set_serializer import TrainingSetSerializer
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class Meta:
"""

model = AlternativeWord
fields = ("alt_word", "article")
fields = ("alt_word", "singular_article")
2 changes: 1 addition & 1 deletion lunes_cms/api/v1/serializers/discipline_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_total_discipline_children(self, obj):
:param disc: Discipline instance
:type disc: models.Discipline
:type disc: ~lunes_cms.cms.models.discipline.Discipline
:return: sum of children
:rtype: int
"""
Expand Down
Loading

0 comments on commit 29ab438

Please sign in to comment.