Skip to content

Commit

Permalink
fix mark time not updated when change status
Browse files Browse the repository at this point in the history
  • Loading branch information
Her Email authored and alphatownsman committed Nov 21, 2023
1 parent 2e52ecf commit 566868b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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."
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
3 changes: 1 addition & 2 deletions journal/models/mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
8 changes: 7 additions & 1 deletion takahe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 566868b

Please sign in to comment.