Compare commits

..

No commits in common. "86bc48f3e0b57bd63673324c1177e93da806de7a" and "2772ee7188ee6277bace555425c73106b425f939" have entirely different histories.

8 changed files with 10 additions and 17 deletions

View File

@ -5,7 +5,6 @@ on: [push, pull_request]
jobs:
test_docs:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: ["3.10"]

View File

@ -12,7 +12,6 @@ jobs:
test:
name: test py${{ matrix.python-version }} with ${{ matrix.db_name }}
runs-on: ubuntu-latest
timeout-minutes: 8
strategy:
matrix:
python-version: ["3.10", "3.11"]

View File

@ -12,7 +12,6 @@ from django.utils.safestring import mark_safe
from core.files import get_remote_file
from core.html import strip_html
from core.ld import format_ld_date
from core.models import Config
from core.uploads import upload_emoji_namer
from core.uris import AutoAbsoluteUrl, RelativeAbsoluteUrl, StaticAbsoluteUrl
@ -219,14 +218,13 @@ class Emoji(StatorModel):
"""
return {
"id": self.object_uri or f"https://{settings.MAIN_DOMAIN}/emoji/{self.pk}/",
"type": "Emoji",
"name": f":{self.shortcode}:",
"type": "toot:Emoji",
"name": self.shortcode,
"icon": {
"type": "Image",
"mediaType": self.mimetype,
"url": self.full_url().absolute,
},
"updated": format_ld_date(self.updated),
}
@classmethod

View File

@ -180,7 +180,7 @@ class Post(StatorModel):
local = models.BooleanField()
# The canonical object ID
object_uri = models.CharField(max_length=2048, blank=True, null=True, unique=True)
object_uri = models.CharField(max_length=500, blank=True, null=True, unique=True)
# Who should be able to see this Post
visibility = models.IntegerField(
@ -197,7 +197,7 @@ class Post(StatorModel):
summary = models.TextField(blank=True, null=True)
# The public, web URL of this Post on the original server
url = models.CharField(max_length=2048, blank=True, null=True)
url = models.CharField(max_length=500, blank=True, null=True)
# The Post it is replying to as an AP ID URI
# (as otherwise we'd have to pull entire threads to use IDs)

View File

@ -96,7 +96,7 @@ class PostAttachment(StatorModel):
"width": self.width,
"height": self.height,
"mediaType": self.mimetype,
"blurhash": self.blurhash,
"toot:focalPoint": [0, 0],
}
### Mastodon Client API ###

View File

@ -410,15 +410,12 @@ def canonicalise(json_data: dict, include_security: bool = False) -> dict:
context = [
"https://www.w3.org/ns/activitystreams",
{
"blurhash": "toot:blurhash",
"Emoji": "toot:Emoji",
"focalPoint": {"@container": "@list", "@id": "toot:focalPoint"},
"Hashtag": "as:Hashtag",
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"Public": "as:Public",
"sensitive": "as:sensitive",
"toot": "http://joinmastodon.org/ns#",
"votersCount": "toot:votersCount",
"Hashtag": "as:Hashtag",
"Public": "as:Public",
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
},
]
if include_security:

View File

@ -217,7 +217,7 @@ class Identity(StatorModel):
return []
return [
{
"name": imageify_emojis(strip_html(data["name"]), self.domain),
"name": data["name"],
"value": imageify_emojis(strip_html(data["value"]), self.domain),
}
for data in self.metadata

View File

@ -65,7 +65,7 @@ class DomainCreate(FormView):
)
default = forms.BooleanField(
help_text="If this is the default option for new identities",
widget=forms.Select(choices=[(False, "No"), (True, "Yes")]),
widget=forms.Select(choices=[(True, "Yes"), (False, "No")]),
required=False,
)