Commit Graph

4792 Commits

Author SHA1 Message Date
Quantum
e381e1f9b8 Return 404 for non-existent users 2024-09-16 02:37:45 +00:00
Quantum
7cb7486e55 Use lowest tier judge only and hold the rest in reserve 2024-08-22 02:52:26 +00:00
Quantum
795d19131d Add tier field to judge model 2024-08-22 02:52:26 +00:00
Nguyen Viet Dung
8cebcedfa2 Protect stateful admin endpoints against CSRF 2024-07-31 18:13:33 -04:00
Tudor Brindus
d6a3ff389d api: add submission filtering by contest + contest info 2024-06-02 20:59:10 +00:00
int-y1
c3873d671c Fix i18n in js strings 2024-05-28 02:03:40 +00:00
int-y1
d2e9fac6a9 Fix comment revision count 2024-05-26 17:48:37 +00:00
Nguyen Viet Dung
724af7ef77 Fix vulnerable endpoints due to the lack of permission check 2024-04-22 12:09:43 -04:00
tandr3w
bc6aef13e7 Make markdown tables horizontally scrollable by default 2024-03-18 03:07:55 +00:00
Fher
df99fe3e23
New settings for disabling comments and social 2024-02-08 23:47:27 -05:00
int-y1
86c234f2a1 Add Kazakh language option in UI 2024-01-24 22:28:21 +00:00
Keenan Gugeler
435839e6b3 Add batch dependencies to site data interface 2024-01-21 07:04:31 +00:00
Keenan Gugeler
9c513c2453 views/data: fix get_valid_files
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.
2024-01-09 05:40:45 +00:00
Keenan Gugeler
1bacacb83e Validate site data file names and contents
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.
2024-01-06 06:23:51 +00:00
int-y1
c39f176296 Sort contest users with 0 points by submission count 2024-01-06 04:54:51 +00:00
Anthony Chen
18e49e0956 Change "Refresh" to "Edit" 2FA on profile page 2024-01-06 04:46:02 +00:00
Tudor Brindus
356b146f37 events: properly publish abort events
I think this should avoid cases of the "Abort" button sticking around.
2023-12-25 21:55:30 +00:00
Tudor Brindus
c126f07fe7 Revert "Completely remove Pagedown" and "Switch all Pagedown editors to Martor"
This reverts commits:
- 2035e606f3
- ce1196f74f

Since they do not interact well with dark mode.
2023-12-25 12:17:56 -05:00
Evan
6baf5c3149 Improve APIv2
- 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.
2023-12-25 02:59:09 +00:00
Evan
2035e606f3 Completely remove Pagedown 2023-12-18 03:57:22 +00:00
Evan
ce1196f74f Switch all Pagedown editors to Martor 2023-12-18 03:57:22 +00:00
Evan
292ba1a600 Implement user email change functionality; #1996 2023-10-30 11:48:36 +00:00
Evan
c3fb2d717d Fix user admin object creation and deletion; #931, #2288
- Automatically create profile when adding a user through admin
- Disallow adding profiles through admin
- (Soft) disallow deleting profiles through admin
2023-10-28 22:48:33 +00:00
int-y1
d6dd630b3e Use consistent capitals for admin column descriptions 2023-10-11 12:26:48 +00:00
int-y1
79be4af4b5 Use decorator for admin display functions 2023-08-26 03:38:05 +00:00
int-y1
138ce7fc99 Improve import locations 2023-08-26 01:59:15 +00:00
int-y1
7294d223a2 Clean up code for chart colors 2023-08-25 08:56:17 +00:00
Evan
af8bf0cd01 Fix AttributeError when rendering translated problem PDFs 2023-08-24 02:42:52 +00:00
int-y1
ee60a175f3 Fix filtering problems by full AC 2023-08-23 19:02:27 +00:00
Guanzhong Chen
89fec36398
Revert "Change "Refresh" to "Edit" 2FA on profile page" (#2270)
This reverts commit b698088b50.
2023-07-12 00:25:42 -04:00
Anthony Chen
b698088b50 Change "Refresh" to "Edit" 2FA on profile page 2023-07-12 01:19:47 +00:00
jazyz
64a1eca408 Sort Organizations by Name
Closes #2190
2023-07-12 01:09:52 +00:00
Tudor Brindus
ddc624b602 Relabel the version matrix page to just "Versions" 2023-06-11 20:57:44 -04:00
Le Bao Hiep
d98db84cdf UserList: sort users by id 2023-05-27 23:14:54 +00:00
Evan
20dd8d4f78 Autofocus TOTP input field when logging in 2023-03-31 17:35:20 +00:00
Evan
81810eec69 Only use dark theme ace widget if experimental features are on; #2035 2023-03-11 23:56:41 +00:00
Tudor Brindus
3e597c03b1 Simplify PDF rendering backend
- 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>
2023-03-09 13:33:44 +02:00
Tudor Brindus
473a77d824 Record request language in uWSGI logs 2023-03-06 06:10:06 +00:00
Tudor Brindus
1f2515515a Implement basic pdfoid-based renderer 2023-03-05 20:53:12 +00:00
Tudor Brindus
2605b3fa6f Only allow /users/ searching of listed users
Fixes #2212.
2023-03-05 20:46:14 +00:00
Tudor Brindus
30002c09ac texoid: response status is in status_code, not status 2023-03-05 17:27:26 +00:00
kiritofeng
529c05fa2a Fix bug with non-existent organizations 2023-03-05 02:46:51 +00:00
Quantum
a938ab00ab Define slug_url_kwarg for BaseOrganizationListView 2023-03-05 02:45:45 +00:00
int-y1
b8563cce26 Check for bad chars in problem title 2023-03-04 20:30:28 +00:00
Tudor Brindus
4fe609f740 Load PDF resources by URL
We were already not embedding all of them, and this is a prerequisite to making
use of pdfoid in the short term.
2023-03-04 20:27:58 +00:00
Tudor Brindus
99c1ce01be Remove old PDF renderers
The SlimerJS and PhantomJS backends have not been used in many years, are
undocumented, and should not be used.
2023-02-26 19:39:08 +00:00
Quantum
9c9a6d556a Remove widgets/relative-time.html fragment 2023-02-23 05:52:55 +00:00
Quantum
08bcb3c231 Remove user/link.html fragment 2023-02-23 05:52:55 +00:00
Quantum
eda67c54e2 Rework misc config to run exactly one query
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.
2023-02-23 04:10:57 +00:00
Quantum
6ecec69904 Report username to uwsgi as a log variable 2023-02-22 06:10:27 +00:00