Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge v1.0.3 release #1519

Merged
merged 14 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,44 @@ Changelog for the **SODAR Core** Django app package. Loosely follows the
`Keep a Changelog <http://keepachangelog.com/en/1.0.0/>`_ guidelines.


v1.0.3 (2024-12-12)
===================

Added
-----

- **Projectroles**
- Info link for finder role in ``ProjectRoleView`` (#1511)
- Table and strikethrough support in ``render_markdown()`` (#1272)
- ``sodar-markdown-content`` CSS class (#1272)
- **Timeline**
- User count in siteinfo stats (#1504)
- Plugin tests (#1506)
- **Userprofile**
- Authentication type in user details (#1500)

Changed
-------

- **General**
- Upgrade minimum Django version to v4.2.17 (#1516)
- Update dependency pinning (#1509)
- **Projectroles**
- Update default OIDC login button template (#1503)
- Update ownership transfer timeline event data (#1514)
- Refactor ``syncremote`` management command (#1518)

Fixed
-----

- **Projectroles**
- Deprecated ``SODAR_API_*`` settings required in tests (#1495)
- Add workaround to ``ProjectInviteCreateView`` returning 404 with category and query string (#1510)
- Broken tour help attachments in ``ProjectRoleView`` (#1512)
- ``RoleAssignmentCreateView`` crash as delegate with promoting and delegate limit reached (#1515)
- ``syncremote`` command crash from legacy API media type and version (#1517)


v1.0.2 (2024-09-09)
===================

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ and breaking changes are possible.

.. code-block:: console

pip install django-sodar-core==1.0.2
pip install django-sodar-core==1.0.3

For installing a development version you can point your dependency to a specific
commit ID in GitHub. Note that these versions may not be stable.
Expand Down
7 changes: 3 additions & 4 deletions adminalerts/templates/adminalerts/alert_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ <h2><i class="iconify" data-icon="mdi:alert"></i> Admin Alert</h2>
<dd class="col-md-12 px-0 mx-0">
<hr />
</dd>
<dd class="col-md-12 my-0">
{% autoescape off %}
{% render_markdown object.description.raw %}
{% endautoescape %}
<dd class="col-md-12 my-0 sodar-markdown-content">
{% render_markdown object.description.raw as desc %}
{{ desc | safe }}
</dd>
{% endif %}
</dl>
Expand Down
8 changes: 4 additions & 4 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
],
"identifier": "https://doi.org/10.5281/zenodo.4269346",
"codeRepository": "https://github.com/bihealth/sodar-core",
"datePublished": "2023-12-06",
"dateModified": "2023-12-06",
"dateCreated": "2024-09-09",
"datePublished": "2024-12-12",
"dateModified": "2024-12-12",
"dateCreated": "2019-06-26",
"description": "SODAR Core: A Django-based framework for scientific data management and analysis web apps",
"keywords": "Python, Django, scientific data managmenent, software library",
"license": "MIT",
"title": "SODAR Core",
"version": "v1.0.2"
"version": "v1.0.3"
}
6 changes: 3 additions & 3 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,9 @@ def set_logging(level=None):

# SODAR API settings
# DEPRECATED: To be removed in SODAR Core v1.1 (see #1401)
SODAR_API_DEFAULT_VERSION = '0.1'
SODAR_API_ALLOWED_VERSIONS = [SODAR_API_DEFAULT_VERSION]
SODAR_API_MEDIA_TYPE = 'application/your.application+json'
# SODAR_API_DEFAULT_VERSION = '0.1'
# SODAR_API_ALLOWED_VERSIONS = [SODAR_API_DEFAULT_VERSION]
# SODAR_API_MEDIA_TYPE = 'application/your.application+json'
# SODAR API host URL
SODAR_API_DEFAULT_HOST = env.url(
'SODAR_API_DEFAULT_HOST', 'http://0.0.0.0:8000'
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# The short X.Y version
version = '1.0'
# The full version, including alpha/beta/rc tags
release = '1.0.2'
release = '1.0.3'


# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion docs/source/dev_resource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ documentation for more information on how to customize your widget.
Markdown
--------

For fields supporting markdown, it is recommended to use the
For fields supporting Markdown, it is recommended to use the
``SODARPagedownWidget`` found in ``projectroles.models``.

.. hint::

When rendering Markdown fields in templates, add the
``sodar-markdown-content`` CSS class to the field's parent container for
improved Markdown styling.

Submit Multi-Click Protection
-----------------------------

Expand Down
25 changes: 25 additions & 0 deletions docs/source/major_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ older SODAR Core version. For a complete list of changes in current and previous
releases, see the :ref:`full changelog<changelog>`.


v1.0.3 (2024-12-12)
*******************

Release Highlights
==================

- Add auth type in user profile details card
- Add user count in timeline siteinfo statistics
- Add finder role info link in member list
- Add table and strikethrough support for markdown content
- Fix invite create view redirect failing in categories
- Fix role promoting crash as delegate with delegate limit reached
- Fix requiring deprecated SODAR API settings in tests
- Fix syncremote management command crash
- General bug fixes and minor updates

Breaking Changes
================

System Prerequisites
--------------------

The minimum Django version has been bumped to v4.2.17.


v1.0.2 (2024-09-09)
*******************

Expand Down
2 changes: 1 addition & 1 deletion example_site/templates/include/_login_oidc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<a role="button" class="btn btn-md btn-success btn-block"
id="sodar-login-oidc-link"
href="{% url 'social:begin' 'oidc' %}?next={{ oidc_redirect_url|default:'/' }}">
<i class="iconify" data-icon="mdi:login-variant"></i> OpenID Connect Login
<i class="iconify" data-icon="mdi:login-variant"></i> Single Sign-On Login
</a>
2 changes: 1 addition & 1 deletion projectroles/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def __init__(
self.fields['role'].initial = max(
[c[0] for c in self.fields['role'].choices]
)
if not promote_as:
else:
self.fields['role'].initial = Role.objects.get(
name=PROJECT_ROLE_GUEST
).pk
Expand Down
51 changes: 11 additions & 40 deletions projectroles/management/commands/syncremote.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
"""Syncremote management command for synchronizing remote projects"""

import json
import ssl
import sys
import urllib.request

from django.conf import settings
from django.core.management.base import BaseCommand
from django.urls import reverse

from projectroles.management.logging import ManagementCommandLogger
from projectroles.models import RemoteSite, SODAR_CONSTANTS
from projectroles.remote_projects import RemoteProjectAPI
from projectroles.views_api import CORE_API_MEDIA_TYPE, CORE_API_DEFAULT_VERSION


logger = ManagementCommandLogger(__name__)
Expand All @@ -24,12 +19,13 @@


class Command(BaseCommand):
help = 'Synchronizes user and project data from a remote site'
help = 'Synchronizes user and project data from the source site'

def add_arguments(self, parser):
pass

def handle(self, *args, **options):
remote_api = RemoteProjectAPI()
if getattr(settings, 'PROJECTROLES_DISABLE_CATEGORIES', False):
logger.info(
'Project categories and nesting disabled, '
Expand All @@ -39,11 +35,10 @@ def handle(self, *args, **options):
if settings.PROJECTROLES_SITE_MODE != SITE_MODE_TARGET:
logger.error('Site not in TARGET mode, unable to sync')
sys.exit(1)

try:
site = RemoteSite.objects.get(mode=SITE_MODE_SOURCE)
source_site = RemoteSite.objects.get(mode=SITE_MODE_SOURCE)
except RemoteSite.DoesNotExist:
logger.error('No source site defined, unable to sync')
logger.error('No source site set, unable to sync')
sys.exit(1)

if getattr(settings, 'PROJECTROLES_ALLOW_LOCAL_USERS', False):
Expand All @@ -52,46 +47,22 @@ def handle(self, *args, **options):
'roles for existing local users'
)
logger.info(
'Retrieving data from remote site "{}" ({})..'.format(
site.name, site.get_url()
'Retrieving data from source site "{}" ({})..'.format(
source_site.name, source_site.get_url()
)
)
api_url = site.get_url() + reverse(
'projectroles:api_remote_get', kwargs={'secret': site.secret}
)

try:
api_req = urllib.request.Request(api_url)
api_req.add_header(
'accept',
'{}; version={}'.format(
CORE_API_MEDIA_TYPE, CORE_API_DEFAULT_VERSION
),
)
response = urllib.request.urlopen(api_req)
remote_data = json.loads(response.read())

remote_data = remote_api.get_remote_data(source_site)
except Exception as ex:
helper_text = ''
if (
isinstance(ex, urllib.error.URLError)
and isinstance(ex.reason, ssl.SSLError)
and ex.reason.reason == 'WRONG_VERSION_NUMBER'
):
helper_text = (
' (most likely the server cannot handle HTTPS requests)'
)
logger.error(
'Unable to retrieve data from remote site: {}{}'.format(
ex, helper_text
)
'Failed to retrieve data from source site: {}'.format(ex)
)
sys.exit(1)

remote_api = RemoteProjectAPI()
logger.info('Synchronizing remote data from source site..')
try:
remote_api.sync_remote_data(site, remote_data)
remote_api.sync_remote_data(source_site, remote_data)
except Exception as ex:
logger.error('Remote sync cancelled with exception: {}'.format(ex))
logger.error('Remote sync failed with exception: {}'.format(ex))
sys.exit(1)
logger.info('Syncremote command OK')
2 changes: 1 addition & 1 deletion projectroles/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def get_app_plugin(plugin_name, plugin_type=None):

:param plugin_name: Plugin name (string)
:param plugin_type: Plugin type (string or None for all types)
:return: Plugin object or None if not found
:return: Plugin object or None if not found or inactive
"""
if plugin_type:
plugin_types = [PLUGIN_TYPES[plugin_type]]
Expand Down
Loading