diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8c9caddc..9f7609b0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,6 +14,13 @@ jobs: runs-on: ubuntu-latest environment: ${{ vars.DEPLOY_ENV }} steps: + - name: Send start notification + uses: appleboy/discord-action@master + with: + webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }} + webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} + color: "#6848a9" + message: "Deployment started." - name: ssh uses: appleboy/ssh-action@master with: @@ -22,10 +29,10 @@ jobs: username: ${{ secrets.SSH_USER }} key: ${{ secrets.SSH_KEY }} script: ${{ vars.DEPLOY_SCRIPT }} - - - name: Send Discord notification + - name: Send complete notification uses: appleboy/discord-action@master with: webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }} webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} - args: Deployment complete. + color: "#6848a9" + message: "Deployment complete." diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a8c14149..28278fc2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,7 +36,8 @@ jobs: with: webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }} webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} - args: Building docker image ${{ steps.version.outputs.neodb }}-${{ steps.version.outputs.takahe }} + color: "#1857a4" + message: Building docker image ${{ steps.version.outputs.neodb }}-${{ steps.version.outputs.takahe }} - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -71,4 +72,5 @@ jobs: with: webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }} webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} - args: Published docker image ${{ steps.version.outputs.neodb }}-${{ steps.version.outputs.takahe }} + color: "#1857a4" + message: Published docker image ${{ steps.version.outputs.neodb }}-${{ steps.version.outputs.takahe }} diff --git a/journal/models/mark.py b/journal/models/mark.py index 893e68f4..8272cd02 100644 --- a/journal/models/mark.py +++ b/journal/models/mark.py @@ -210,8 +210,7 @@ def update( d = {"parent": shelf, "visibility": visibility, "position": 0} if metadata: d["metadata"] = metadata - if created_time: - d["created_time"] = created_time + d["created_time"] = created_time or timezone.now() self.shelfmember, _ = ShelfMember.objects.update_or_create( owner=self.owner, item=self.item, defaults=d ) diff --git a/takahe/utils.py b/takahe/utils.py index 499c4d9c..3b08adb8 100644 --- a/takahe/utils.py +++ b/takahe/utils.py @@ -524,7 +524,13 @@ def post_mark(mark, share_as_new_post: bool) -> Post | None: v = Takahe.visibility_n2t( mark.visibility, user.preference.mastodon_publish_public ) - existing_post = None if share_as_new_post else mark.shelfmember.latest_post + existing_post = ( + None + if share_as_new_post + or mark.shelfmember.latest_post is None + or mark.shelfmember.latest_post.state in ["deleted", "deleted_fanned_out"] + else mark.shelfmember.latest_post + ) post = Takahe.post( mark.owner.pk, pre_conetent,