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

chore: added epoch in draft #2244

Merged
merged 2 commits into from
Sep 22, 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
6 changes: 3 additions & 3 deletions apiserver/plane/api/views/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def perform_destroy(self, instance):
issue_id=str(self.kwargs.get("pk", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return super().perform_destroy(instance)
Expand Down Expand Up @@ -576,7 +576,7 @@ def perform_destroy(self, instance):
issue_id=str(self.kwargs.get("pk", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return super().perform_destroy(instance)

Expand Down Expand Up @@ -752,7 +752,7 @@ def create(self, request, slug, project_id, cycle_id):
),
}
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

# Return all Cycle Issues
Expand Down
8 changes: 4 additions & 4 deletions apiserver/plane/api/views/inbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def create(self, request, slug, project_id, inbox_id):
issue_id=str(issue.id),
project_id=str(project_id),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
# create an inbox issue
InboxIssue.objects.create(
Expand Down Expand Up @@ -278,7 +278,7 @@ def partial_update(self, request, slug, project_id, inbox_id, pk):
IssueSerializer(current_instance).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
issue_serializer.save()
else:
Expand Down Expand Up @@ -520,7 +520,7 @@ def create(self, request, slug, project_id, inbox_id):
issue_id=str(issue.id),
project_id=str(project_id),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
# create an inbox issue
InboxIssue.objects.create(
Expand Down Expand Up @@ -585,7 +585,7 @@ def partial_update(self, request, slug, project_id, inbox_id, pk):
IssueSerializer(current_instance).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
issue_serializer.save()
return Response(issue_serializer.data, status=status.HTTP_200_OK)
Expand Down
59 changes: 30 additions & 29 deletions apiserver/plane/api/views/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def perform_update(self, serializer):
current_instance=json.dumps(
IssueSerializer(current_instance).data, cls=DjangoJSONEncoder
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return super().perform_update(serializer)
Expand All @@ -151,7 +151,7 @@ def perform_destroy(self, instance):
current_instance=json.dumps(
IssueSerializer(current_instance).data, cls=DjangoJSONEncoder
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return super().perform_destroy(instance)

Expand Down Expand Up @@ -318,7 +318,7 @@ def create(self, request, slug, project_id):
issue_id=str(serializer.data.get("id", None)),
project_id=str(project_id),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Expand Down Expand Up @@ -577,7 +577,7 @@ def perform_create(self, serializer):
issue_id=str(self.kwargs.get("issue_id")),
project_id=str(self.kwargs.get("project_id")),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

def perform_update(self, serializer):
Expand All @@ -596,7 +596,7 @@ def perform_update(self, serializer):
IssueCommentSerializer(current_instance).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return super().perform_update(serializer)
Expand All @@ -618,7 +618,7 @@ def perform_destroy(self, instance):
IssueCommentSerializer(current_instance).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return super().perform_destroy(instance)

Expand Down Expand Up @@ -902,7 +902,7 @@ def perform_create(self, serializer):
issue_id=str(self.kwargs.get("issue_id")),
project_id=str(self.kwargs.get("project_id")),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

def perform_update(self, serializer):
Expand All @@ -921,7 +921,7 @@ def perform_update(self, serializer):
IssueLinkSerializer(current_instance).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return super().perform_update(serializer)
Expand All @@ -943,7 +943,7 @@ def perform_destroy(self, instance):
IssueLinkSerializer(current_instance).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return super().perform_destroy(instance)

Expand Down Expand Up @@ -1022,7 +1022,7 @@ def post(self, request, slug, project_id, issue_id):
serializer.data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Expand All @@ -1045,7 +1045,7 @@ def delete(self, request, slug, project_id, issue_id, pk):
issue_id=str(self.kwargs.get("issue_id", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return Response(status=status.HTTP_204_NO_CONTENT)
Expand Down Expand Up @@ -1248,7 +1248,7 @@ def unarchive(self, request, slug, project_id, pk=None):
issue_id=str(issue.id),
project_id=str(project_id),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return Response(IssueSerializer(issue).data, status=status.HTTP_200_OK)
Expand Down Expand Up @@ -1453,7 +1453,7 @@ def perform_create(self, serializer):
issue_id=str(self.kwargs.get("issue_id", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

def destroy(self, request, slug, project_id, issue_id, reaction_code):
Expand All @@ -1477,7 +1477,7 @@ def destroy(self, request, slug, project_id, issue_id, reaction_code):
"identifier": str(issue_reaction.id),
}
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
issue_reaction.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
Expand Down Expand Up @@ -1526,7 +1526,7 @@ def perform_create(self, serializer):
issue_id=None,
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

def destroy(self, request, slug, project_id, comment_id, reaction_code):
Expand All @@ -1551,7 +1551,7 @@ def destroy(self, request, slug, project_id, comment_id, reaction_code):
"comment_id": str(comment_id),
}
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
comment_reaction.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
Expand Down Expand Up @@ -1648,7 +1648,7 @@ def create(self, request, slug, project_id, issue_id):
issue_id=str(issue_id),
project_id=str(project_id),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
if not ProjectMember.objects.filter(
project_id=project_id,
Expand Down Expand Up @@ -1698,7 +1698,7 @@ def partial_update(self, request, slug, project_id, issue_id, pk):
IssueCommentSerializer(comment).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return Response(serializer.data, status=status.HTTP_200_OK)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Expand Down Expand Up @@ -1732,7 +1732,7 @@ def destroy(self, request, slug, project_id, issue_id, pk):
IssueCommentSerializer(comment).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
comment.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
Expand Down Expand Up @@ -1807,7 +1807,7 @@ def create(self, request, slug, project_id, issue_id):
issue_id=str(self.kwargs.get("issue_id", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Expand Down Expand Up @@ -1852,7 +1852,7 @@ def destroy(self, request, slug, project_id, issue_id, reaction_code):
"identifier": str(issue_reaction.id),
}
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
issue_reaction.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
Expand Down Expand Up @@ -1926,7 +1926,7 @@ def create(self, request, slug, project_id, comment_id):
issue_id=None,
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Expand Down Expand Up @@ -1978,7 +1978,7 @@ def destroy(self, request, slug, project_id, comment_id, reaction_code):
"comment_id": str(comment_id),
}
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
comment_reaction.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
Expand Down Expand Up @@ -2042,7 +2042,7 @@ def create(self, request, slug, project_id, issue_id):
issue_id=str(self.kwargs.get("issue_id", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
serializer = IssueVoteSerializer(issue_vote)
return Response(serializer.data, status=status.HTTP_201_CREATED)
Expand Down Expand Up @@ -2077,7 +2077,7 @@ def destroy(self, request, slug, project_id, issue_id):
"identifier": str(issue_vote.id),
}
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
issue_vote.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
Expand Down Expand Up @@ -2111,7 +2111,7 @@ def perform_destroy(self, instance):
IssueRelationSerializer(current_instance).data,
cls=DjangoJSONEncoder,
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return super().perform_destroy(instance)

Expand Down Expand Up @@ -2145,7 +2145,7 @@ def create(self, request, slug, project_id, issue_id):
issue_id=str(issue_id),
project_id=str(project_id),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

if relation == "blocking":
Expand Down Expand Up @@ -2417,7 +2417,7 @@ def perform_update(self, serializer):
current_instance=json.dumps(
IssueSerializer(current_instance).data, cls=DjangoJSONEncoder
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return super().perform_update(serializer)
Expand All @@ -2439,6 +2439,7 @@ def perform_destroy(self, instance):
current_instance=json.dumps(
IssueSerializer(current_instance).data, cls=DjangoJSONEncoder
),
epoch=int(timezone.now().timestamp())
)
return super().perform_destroy(instance)

Expand Down Expand Up @@ -2602,7 +2603,7 @@ def create(self, request, slug, project_id):
issue_id=str(serializer.data.get("id", None)),
project_id=str(project_id),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return Response(serializer.data, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Expand Down
6 changes: 3 additions & 3 deletions apiserver/plane/api/views/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def perform_destroy(self, instance):
issue_id=str(self.kwargs.get("pk", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return super().perform_destroy(instance)
Expand Down Expand Up @@ -342,7 +342,7 @@ def perform_destroy(self, instance):
issue_id=str(self.kwargs.get("pk", None)),
project_id=str(self.kwargs.get("project_id", None)),
current_instance=None,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
return super().perform_destroy(instance)

Expand Down Expand Up @@ -510,7 +510,7 @@ def create(self, request, slug, project_id, module_id):
),
}
),
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)

return Response(
Expand Down
4 changes: 2 additions & 2 deletions apiserver/plane/bgtasks/issue_automation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def archive_old_issues():
project_id=project_id,
current_instance=None,
subscriber=False,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
for issue in updated_issues
]
Expand Down Expand Up @@ -149,7 +149,7 @@ def close_old_issues():
project_id=project_id,
current_instance=None,
subscriber=False,
epoch = int(timezone.now().timestamp())
epoch=int(timezone.now().timestamp())
)
for issue in updated_issues
]
Expand Down
Loading