Before #2197, `get_valid_files` returned a `List[str]`. Then it returned
an `Option[List[str]]`, because we wanted to flag invalid zips. This
caused issues with iterating, and is a pretty terrible design.
Instead, we just re-raise the BadZipfile, and handle it in the two
places this function is used.
Fixes#2196. The old check for zip file format correctness was broken.
We also need a check for generator names. Furthermore, invalid zip files
were never properly caught.
- Sort all list endpoints by ID, which reduces the likelihood of objects
moving between pages during requests. Objects will only shift if an
object is deleted, which usually does not happen.
- Add a list filter for ID (and other identifier fields), so users can
request a list of only the objects they care about (rather than
requesting all and then filtering on their side)
- Use the rating from Profile.rating instead of re-computing it each
time. This attribute should already be updated during each contest
rate.
- Automatically create profile when adding a user through admin
- Disallow adding profiles through admin
- (Soft) disallow deleting profiles through admin
- Drop Puppeteer and Selenium backends
- "Inline" pdfoid, and move `pdf_problems.py` to `utils` + rename it
`pdfoid.py`
- Drop a lot of pointless error checking; if we fail we'll want to raise
a 500 regardless
Co-authored-by: Quantum <quantum2048@gmail.com>
There should never be that much stuff in MiscConfig, so let's just read
it all and deal with it in python instead of trying to run one query
for each item of interest and poorly cache it.
This PR also moved MiscConfigDict into a middleware so it can be used
outside of templates.