* formatmaxxing brained formatting
* formatmaxxing brained formatting: EPISODE 2
* Start implementing a .json interface for all logged users reddit-like
PROs:
- easier to debugmaxx applications
- good faith actors can scrap the site more easly :gigachadglow:
CONs:
- bad faith actors can scrap the site more easly :gigachadglow:
- jannitors lose a little of their power of allowlisting applications (they do it for free though)
anyways. I make this commit a separate commit so that Snakes can esclude it from the PR if he doesn't like it (cringe)
* /<username>/comments route now returns appropriate [citation needed] HTTP codes when called in JSON mode so that stupid JSON clients can crashmaxx
* More error codes (sorry I don't know how to squash)
* json endpoint. see other commit. I don't know how to squash
The changes to helpers/get.py @ get_user(...) in a6b7fed2fc resulted
in `is_blocking` no longer being present on all User objects retrieved
via `get_user`. This triggered a latent identifier shadow where the
property method `User.is_blocking` on the User model caused checks for
blocks on objects retrieved via `get_user` to always return True.
Notably: when the get_user return value left `is_blocking` unset and
thus implied False, the following expression yielded True due to the
presence of the first-class function at the same identifier:
hasattr(user, 'is_blocking') and user.is_blocking
* poll rework
* forgot to do joinedload on comments
* Fix logic errors with voting, SQL syntax.
Kitchen sink commit from review of poll-rework changes:
1. Fix seed-db.sql syntax error.
2. Fix SQL patch file duplication of *submissions* tables rather
than one set of submissions and one for comments.
3. Start makeshift SQL patch folder, since this is a large change
that contributors may wish to apply to their local instances.
4. Fix checkbox (non-`exclusive`) polls being unable to be
unchecked. For consistency with `exclusive` polls, they should.
5. Fix changing the option of an `exclusive` poll when both
exclusive and non-exclusive options are present in one comment/
post causing the non-exclusive options to become unchecked.
(which, by my reading of SQLAlchemy `Query.one_or_none()`
really could break quite badly in some cases).
* link relationships with their counterparts
* small modification to poll unchecking
Co-authored-by: TLSM <duolsm@outlook.com>
The user routes upvoters, downvoters, upvoting, and downvoting
now exclude self-votes from the summary totals.
Also, the diff touches a number of other lines where the local
variable `id` was renamed to `uid` for semantic clarity.