Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mark time not updated when change status #389

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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