Skip to content
Snippets Groups Projects
Verified Commit f949d70b authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch 'master' into application-instead-of-token

parents 0c598b49 f493f004
No related branches found
No related tags found
1 merge request!646Use term "application" for all authorized OAuth2 applications/tokens
Pipeline #15252 passed
......@@ -12,8 +12,15 @@ Unreleased
Changed
~~~~~~~
* Rename every occurance of "social account" by "third-party account".
* Use own templates and views for PWA meta and manifest.
* Use term "application" for all authorized OAuth2 applications/tokens.
* Use importlib instead of pkg_resources (no functional changes)
Fixed
~~~~~
* Fix installation documentation (nginx, uWSGI).
Removed
~~~~~~~
......
import pkg_resources
from importlib import metadata
try:
from .celery import app as celery_app
......@@ -7,7 +7,7 @@ except ModuleNotFoundError:
celery_app = None
try:
__version__ = pkg_resources.get_distribution("AlekSIS-Core").version
__version__ = metadata.distribution("AlekSIS-Core").version
except Exception:
__version__ = "unknown"
......
from importlib import metadata
from typing import Any, Optional, Sequence
import django.apps
......@@ -5,7 +6,6 @@ from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.db.models.signals import post_migrate, pre_migrate
from django.http import HttpRequest
import pkg_resources
from dynamic_preferences.signals import preference_updated
from license_expression import Licensing
from spdx_license_list import LICENSES
......@@ -32,7 +32,7 @@ class AppConfig(django.apps.AppConfig):
self.preference_updated(self)
def get_distribution_name(self):
"""Get pkg_resources distribution name of application package."""
"""Get distribution name of application package."""
if hasattr(self, "dist_name"):
return self.dist_name
elif self.name.lower().startswith("aleksis.apps."):
......@@ -41,12 +41,12 @@ class AppConfig(django.apps.AppConfig):
return None
def get_distribution(self):
"""Get pkg_resources distribution of application package."""
"""Get distribution of application package."""
dist_name = self.get_distribution_name()
if dist_name:
try:
dist = pkg_resources.get_distribution(dist_name)
except pkg_resources.DistributionNotFound:
dist = metadata.distribution(dist_name)
except PackageNotFoundError:
return None
return dist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment