This adds a simple Ignore functionality for topics, with the only effect
being to exclude ignored topics from listing pages.
It also adds a "Your ignored topics" page (linked through the user menu)
that lists all of a user's ignored topics, so that they can access them
if needed (to be able to un-ignore).
gunicorn 20.0.0 included a change so that it will no longer read server
configuration out of Paster files. Because of this, the settings for it
in development.ini and production.ini were no longer being used. This
resulted in the auto-reloading no longer working in dev, and the number
of workers being reduced back down to 1 in production. The socket/PID
may have been impacted as well.
This commit moves the configuration into command-line args used to
launch gunicorn, and uses a pillar variable to handle the args different
between dev and prod.
This required a few minor changes/fixes:
* Change the name of an ignored pylint check about logging interpolation
* Add check=True to all subprocess.run() calls - this probably always
should have been used so the scripts will crash if a command fails
* Remove a couple of unnecessary list comprehensions
* Ignore some warnings caused by mypy @hybrid_property workaround
Previously, scheduled topics just had "Tildes" in place of the name of
the user that posted them, which wasn't very clear. This is a little
more explicit, and uses some different styling for that info on topics
when shown in listings.
As expected, these updates ended up requiring quite a few changes. I was
initially going to update only Marshmallow, but the older version of
webargs couldn't work with an updated Marshmallow, so I ended up needing
to do both at the same time.
The main changes required were:
* Schemas don't need to be specified as "strict" any more, so that could
be removed from constructors and Meta classes.
* .validate() now returns a dict of errors (if any) instead of raising a
ValidationError if anything goes wrong. This meant that I either need
to check the returned dict, or switch to .load() to still get raised
errors.
* Marshmallow doesn't support loading from two different field names as
easily (and changed the name of that to data_key), so all the routes
using "group_path" needed to be changed to just "path".
* Some of the Field methods and some decorated schema ones like
@pre_load receive new arguments and needed to be updated to handle
them and/or pass them on.
* webargs will no longer send a keyword argument for any fields that
aren't specified and don't have a default value when using
@use_kwargs. Because of this, I added missing= values for most
optional fields, but still required some special treatment for the
order query variable in a couple of topic listing views.
And finally, there is some strange behavior in webargs by default when a
form doesn't send any data for a field (due to the input not being
included or similar). When it doesn't find the field in form data, it
tries to fall back to checking for JSON data, but then crashes because
the request doesn't have any JSON data attached. I had to specify only
to look in the form data in a few places to fix this, but I've also
registered an issue against webargs related to it:
https://github.com/marshmallow-code/webargs/issues/444
This will allow people to mouseover a site name/icon if they want to
check which domain its from. Mousing over the title and checking the
link in the status bar would generally accomplish the same thing, but I
think this might feel a bit more intuitive.
This switches comment voting to use the "toggle buttons" that most other
actions are using (e.g. Bookmark). This makes it so that only the vote
button is replaced, instead of the entire comment's contents. This is
mostly significant when the comment contains a <details> block, because
previously voting/unvoting while one of those was expanded would cause
it to collapse when the comment was replaced.
As another side-effect of this, voting will now always appear to
increase the count by 1, and unvoting will always appear to decrease it
by 1. Previously it would re-query the comment, which could result in
larger jumps in the vote count if other people were voting at the same
time. That confused some people, so this will probably be better.
Required a minor change to how mypy is handling enums now. I'm not a big
fan of the result and think it's somewhat incorrect, but the type
annotations in that file are a disaster anyway.
There's no need to show the domain separately on the comments page since
it's being displayed in the link itself just above. This also adds
handling for when there's no info to show, so we won't get the header
and an empty list in those cases.
Very basic version - should probably exclude some of the fields (like
domain) and do some other changes in addition to this, but it's a
reasonable start.
There's still someone trying to use the Tildes donation page to check
stolen credit cards occasionally. The new version of Checkout seems to
be blocking them all successfully, but I might as well not make it easy
on them.
This moves some of the site-specific logic that was previously embedded
in Topic for YouTube and Twitter links into a more general class named
SiteInfo. This should be expanded more in the future, but will help for
defining site names, ways of displaying their content creators, ability
to define a content type on a per-site basis, and so on.
Fixes some minor formatting issues that can come up with code blocks,
since they were previously being treated as inline-block. For example,
this caused list items containing a code block to have a mis-positioned
list item marker.