8000 Jd 2023 06 userdashboard filter 2 by goapunk · Pull Request #2449 · liqd/adhocracy-plus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Jd 2023 06 userdashboard filter 2 #2449

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

Merged
merged 3 commits into from
Jun 8, 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
21 changes: 10 additions & 11 deletions apps/userdashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def actions(self):
Action.objects.filter(
obj_content_type=ContentType.objects.get_for_model(Comment),
verb="add",
target_creator=user,
)
.filter(target_creator=user)
.exclude(
target_content_type__in=[
ContentType.objects.get_for_model(Poll),
Expand All @@ -86,16 +86,15 @@ def actions(self):
obj_content_type=ContentType.objects.get_for_model(
ModeratorCommentFeedback
),
obj_comment_creator=user,
)
.exclude(actor=user)
.select_related("project", "project__organisation")
.prefetch_related("obj__comment__creator", "obj__comment__content_object")
)
filtered_feedback_actions = [
action for action in feedback_actions if action.obj.comment.creator == user
]

return sorted(
filtered_comment_actions + filtered_feedback_actions,
filtered_comment_actions + list(feedback_actions),
key=lambda action: action.timestamp,
reverse=True,
)
Expand Down Expand Up @@ -130,9 +129,10 @@ def actions(self):
user = self.request.user
comment_actions = (
Action.objects.filter(
obj_content_type=ContentType.objects.get_for_model(Comment), verb="add"
obj_content_type=ContentType.objects.get_for_model(Comment),
verb="add",
target_creator=user,
)
.filter(target_creator=user)
.exclude(
target_content_type__in=[
ContentType.objects.get_for_model(Poll),
Expand All @@ -155,16 +155,15 @@ def actions(self):
obj_content_type=ContentType.objects.get_for_model(
ModeratorCommentFeedback
),
obj_comment_creator=user,
)
.exclude(actor=user)
.select_related("project")
.prefetch_related("obj__comment__creator")
)
filtered_feedback_actions = [
action for action in feedback_actions if action.obj.comment.creator == user
]

return sorted(
filtered_comment_actions + filtered_feedback_actions,
filtered_comment_actions + list(feedback_actions),
key=lambda action: action.timestamp,
reverse=True,
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@fortawesome/fontawesome-free": "5.15.4",
"@maplibre/maplibre-gl-leaflet": "0.0.19",
"adhocracy4": "git+https://github.com/liqd/adhocracy4#aplus-v2305.1",
"adhocracy4": "git+https://github.com/liqd/adhocracy4#ba8ccb9895733a0b65be46ee3d30defeacee7edf",
"autoprefixer": "10.4.14",
"bootstrap": "5.2.3",
"css-loader": "6.7.4",
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
4CC2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# A4
git+https://github.com/liqd/adhocracy4.git@aplus-v2305.1#egg=adhocracy4
git+https://github.com/liqd/adhocracy4.git@ba8ccb9895733a0b65be46ee3d30defeacee7edf#egg=adhocracy4

# Additional requirements
brotli==1.0.9
Expand Down
0