10 Commits

Author SHA1 Message Date
Natalie Tay
539938ba59
FIX: Solutions directory item was using post creation instead of solved creation (#361)
Earlier on in the migration, the update of the user directory query was erroneously switched to use post creation date instead of the date the post was solved.

This commit fixes that.
2025-04-09 14:14:38 +08:00
Natalie Tay
37003f91ef
FIX: Exclude deleted topics and posts as solution in user summary (#358)
Follow up to #352

The user summary solutions count is more than it should be because of deleted topics and posts.
2025-04-04 16:43:00 +08:00
Natalie Tay
be5798f6d8
FIX: Standardise the definition of what a solution is (#352)
There are three locations where a user's solution query is defined
- user summary
- user card
- user directory

This PR updates the queries to use data from the new `SolvedTopics` table instead of the `UserActions` table. And adds testssssss
2025-03-28 09:49:02 +08:00
Natalie Tay
1805184cde
FIX: Multiple topics may have the same post as its solution (#348)
We are seeing some errors when migrating and adding indexes on `answer_post_id`.

```
#<StandardError:"An error has occurred, all later migrations canceled:\n\nPG::UniqueViolation: ERROR:  could not create unique index \"index_discourse_solved_solved_topics_on_answer_post_id\"\nDETAIL:  Key (answer_post_id)=(13006) is duplicated.\n">
```

This PR modifies the earlier migration, and also adds one before the addition of indexes to remove duplicates.
2025-03-26 22:21:32 +08:00
Martin Brennan
3d3f20b68d
Revert "FIX: Use Guardian.basic_user instead of new (anon) (#270)" (#271)
This reverts commit 7edf6d86e4dd88bfdcf24a9659378f91f14ff25a.
2023-12-06 16:26:40 +10:00
Martin Brennan
7edf6d86e4
FIX: Use Guardian.basic_user instead of new (anon) (#270)
c.f. de983796e1b66aa2ab039a4fb6e32cec8a65a098

There will soon be additional login_required checks
for Guardian, and the intent of many checks by automated
systems is better fulfilled by using BasicUser, which
simulates a logged in TL0 forum user, rather than an
anon user.
2023-12-06 12:00:43 +10:00
David Taylor
14e0800a29
DEV: Introduce syntax_tree for ruby formatting (#217) 2022-12-23 20:36:08 +00:00
Guo Xiang Tan
75046f1d92 Add frozen string literal comment to files. 2019-05-13 11:04:27 +08:00
Vinoth Kannan
0fa41a8b38 PERF: Remove N+1 queries on site serializer. 2019-03-15 17:25:17 +05:30
Vinoth Kannan
5ddd644e00 FEATURE: Show dropdown to filter topic lists by solved status 2019-03-14 00:41:07 +05:30