Skip to content

Commit

Permalink
Add option for Safe Apps to include Telegram ID as a social media link (
Browse files Browse the repository at this point in the history
  • Loading branch information
PooyaRaki authored Jan 13, 2025
1 parent 7cc4604 commit 856b5b9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/safe_apps/migrations/0016_alter_socialprofile_platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 5.1.4 on 2025-01-13 11:38

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("safe_apps", "0015_safeapp_featured"),
]

operations = [
migrations.AlterField(
model_name="socialprofile",
name="platform",
field=models.CharField(
choices=[
("DISCORD", "Discord"),
("GITHUB", "Github"),
("TWITTER", "Twitter"),
("TELEGRAM", "Telegram"),
],
max_length=255,
),
),
]
1 change: 1 addition & 0 deletions src/safe_apps/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Platform(models.TextChoices):
DISCORD = "DISCORD"
GITHUB = "GITHUB"
TWITTER = "TWITTER"
TELEGRAM = "TELEGRAM"

safe_app = models.ForeignKey(SafeApp, on_delete=models.CASCADE)
platform = models.CharField(choices=Platform.choices, max_length=255)
Expand Down
7 changes: 7 additions & 0 deletions src/safe_apps/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,9 @@ def test_multiple_social_profiles(self) -> None:
social_profile_3 = SocialProfileFactory.create(
platform=SocialProfile.Platform.TWITTER, safe_app=safe_app
)
social_profile_4 = SocialProfileFactory.create(
platform=SocialProfile.Platform.TELEGRAM, safe_app=safe_app
)
url = reverse("v1:safe-apps:list")

response = self.client.get(path=url, data=None, format="json")
Expand All @@ -883,6 +886,10 @@ def test_multiple_social_profiles(self) -> None:
"platform": "GITHUB",
"url": social_profile_2.url,
},
{
"platform": "TELEGRAM",
"url": social_profile_4.url,
},
{
"platform": "TWITTER",
"url": social_profile_3.url,
Expand Down

0 comments on commit 856b5b9

Please sign in to comment.