mirror of
https://github.com/makeplane/plane.git
synced 2026-04-25 17:49:35 -05:00
chore: added identifiers in the notification (#5513)
This commit is contained in:
committed by
GitHub
parent
dbecf5cf5e
commit
a3a7053be7
@@ -1,13 +1,11 @@
|
||||
# Python imports
|
||||
import json
|
||||
|
||||
import requests
|
||||
|
||||
# Third Party imports
|
||||
from celery import shared_task
|
||||
|
||||
# Django imports
|
||||
from django.conf import settings
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
@@ -128,7 +128,9 @@ def extract_mentions(issue_instance):
|
||||
"mention-component", attrs={"target": "users"}
|
||||
)
|
||||
|
||||
mentions = [mention_tag["entity_identifier"] for mention_tag in mention_tags]
|
||||
mentions = [
|
||||
mention_tag["entity_identifier"] for mention_tag in mention_tags
|
||||
]
|
||||
|
||||
return list(set(mentions))
|
||||
except Exception:
|
||||
@@ -198,6 +200,16 @@ def create_mention_notification(
|
||||
"actor": str(activity.get("actor_id")),
|
||||
"new_value": str(activity.get("new_value")),
|
||||
"old_value": str(activity.get("old_value")),
|
||||
"old_identifier": (
|
||||
str(activity.get("old_identifier"))
|
||||
if activity.get("old_identifier")
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(activity.get("new_identifier"))
|
||||
if activity.get("new_identifier")
|
||||
else None
|
||||
),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -440,6 +452,24 @@ def notifications(
|
||||
if issue_comment is not None
|
||||
else ""
|
||||
),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get("old_identifier")
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get("new_identifier")
|
||||
else None
|
||||
),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -489,6 +519,28 @@ def notifications(
|
||||
if issue_comment is not None
|
||||
else ""
|
||||
),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"activity_time": issue_activity.get(
|
||||
"created_at"
|
||||
),
|
||||
@@ -572,6 +624,28 @@ def notifications(
|
||||
"old_value": str(
|
||||
issue_activity.get("old_value")
|
||||
),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"activity_time": issue_activity.get(
|
||||
"created_at"
|
||||
),
|
||||
@@ -627,6 +701,28 @@ def notifications(
|
||||
"old_value": str(
|
||||
last_activity.old_value
|
||||
),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -662,7 +758,31 @@ def notifications(
|
||||
"old_value": str(
|
||||
last_activity.old_value
|
||||
),
|
||||
"activity_time": str(last_activity.created_at),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"activity_time": str(
|
||||
last_activity.created_at
|
||||
),
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -719,6 +839,28 @@ def notifications(
|
||||
"old_value"
|
||||
)
|
||||
),
|
||||
"old_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"old_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"new_identifier": (
|
||||
str(
|
||||
issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
)
|
||||
if issue_activity.get(
|
||||
"new_identifier"
|
||||
)
|
||||
else None
|
||||
),
|
||||
"activity_time": issue_activity.get(
|
||||
"created_at"
|
||||
),
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
# Python imports
|
||||
import os
|
||||
import ssl
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import certifi
|
||||
|
||||
# Third party imports
|
||||
import dj_database_url
|
||||
|
||||
Reference in New Issue
Block a user