MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / create_version_notification

Method create_version_notification

core/models.py:565–584  ·  view source on GitHub ↗

Create or update a version update notification. Returns (notification, created) tuple.

(cls, version, release_url=None, release_notes=None)

Source from the content-addressed store, hash-verified

563
564 @classmethod
565 def create_version_notification(cls, version, release_url=None, release_notes=None):
566 """Create or update a version update notification. Returns (notification, created) tuple."""
567 key = f"version-{version}"
568 notification, created = cls.objects.update_or_create(
569 notification_key=key,
570 defaults={
571 'notification_type': cls.NotificationType.VERSION_UPDATE,
572 'priority': cls.Priority.HIGH,
573 'title': f'Version {version} Available',
574 'message': f'A new version of Dispatcharr ({version}) is available.',
575 'action_data': {
576 'version': version,
577 'release_url': release_url,
578 'release_notes': release_notes,
579 },
580 'is_active': True,
581 'admin_only': True,
582 }
583 )
584 return notification, created
585
586 @classmethod
587 def create_setting_recommendation(cls, setting_key, recommended_value, reason, current_value=None):

Callers 1

check_for_version_updateFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected