Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/revamp' into revamp-merge-base
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/caniuse.yml
#	judge/template_context.py
  • Loading branch information
JasonLovesDoggo committed Jan 10, 2025
2 parents 25f4798 + 8d026ad commit 4c6a985
Show file tree
Hide file tree
Showing 78 changed files with 1,091 additions and 329 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: build
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
runs-on: blacksmith-2vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.11'
- name: Install flake8
Expand All @@ -16,15 +16,15 @@ jobs:
flake8 --version
flake8
unit:
runs-on: ubuntu-latest
runs-on: blacksmith-2vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.11'
- name: Cache pip
uses: actions/cache@v4
uses: useblacksmith/cache@v5
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('requirements.txt') }}
Expand All @@ -42,11 +42,11 @@ jobs:
run: coverage xml
- uses: codecov/codecov-action@v4
styles:
runs-on: ubuntu-latest
runs-on: blacksmith-2vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Set up Node 20
uses: actions/setup-node@v4
uses: useblacksmith/setup-node@v5
with:
node-version: 20
- name: Install npm packages
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/caniuse.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/compilemessages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
- 'locale/**'
jobs:
compilemessages:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: useblacksmith/setup-python@v6
with:
python-version: '3.11'
- name: Checkout submodules
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/makemessages.yml

This file was deleted.

100 changes: 0 additions & 100 deletions .github/workflows/updatemessages.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ resources/select2-dmoj.css
resources/style.css
resources/vars.scss
sass_processed
venv
dmojsite
<desired bridge log path>
bridge.log
8 changes: 4 additions & 4 deletions 502.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>502 bad gateway - DMOJ</title>
<title>502 bad gateway - WLMOJ</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
<style>
hr {
margin: 0 22em;
}
Expand Down Expand Up @@ -49,9 +49,9 @@
<br>
<div class="popup">
<div>
<img class="logo" src="/logo.png" alt="DMOJ">
<img class="logo" src="/logo.png" alt="WLMOJ">
</div>
<h1 style="width: 100%;">Oops, the DMOJ is down.</h1>
<h1 style="width: 100%;">Oops, the WLMOJ is down.</h1>
</div>
<br>
<hr>
Expand Down
4 changes: 2 additions & 2 deletions dmoj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@
try:
with open(os.path.join(os.path.dirname(__file__), 'local_settings.py')) as f:
exec(f.read(), globals())
except IOError:
pass
except IOError as e:
raise ImportError('Could not import local_settings.py: %s' % e) from IOError


# Check settings are consistent
Expand Down
25 changes: 10 additions & 15 deletions dmoj/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
from os.path import join

from django.conf import settings
from django.contrib import admin
from django.contrib.auth import views as auth_views
Expand Down Expand Up @@ -368,21 +371,13 @@ def paged_list_view(view, name):
])),
]

favicon_paths = ['apple-touch-icon-180x180.png', 'apple-touch-icon-114x114.png', 'android-chrome-72x72.png',
'apple-touch-icon-57x57.png', 'apple-touch-icon-72x72.png', 'apple-touch-icon.png', 'mstile-70x70.png',
'android-chrome-36x36.png', 'apple-touch-icon-precomposed.png', 'apple-touch-icon-76x76.png',
'apple-touch-icon-60x60.png', 'android-chrome-96x96.png', 'mstile-144x144.png', 'mstile-150x150.png',
'safari-pinned-tab.svg', 'android-chrome-144x144.png', 'apple-touch-icon-152x152.png',
'favicon-96x96.png',
'favicon-32x32.png', 'favicon-16x16.png', 'android-chrome-192x192.png', 'android-chrome-48x48.png',
'mstile-310x150.png', 'apple-touch-icon-144x144.png', 'browserconfig.xml', 'manifest.json',
'apple-touch-icon-120x120.png', 'mstile-310x310.png']

static_lazy = lazy(static, str)
for favicon in favicon_paths:
urlpatterns.append(path(favicon, RedirectView.as_view(
url=static_lazy('icons/' + favicon),
)))
if os.path.exists(join(settings.DMOJ_RESOURCES, 'icons')): # if it doesn't exist, we're probably running on bridged
favicon_paths = os.listdir(join(settings.DMOJ_RESOURCES, 'icons'))
static_lazy = lazy(static, str)
for favicon in favicon_paths:
urlpatterns.append(path(favicon, RedirectView.as_view(
url=static_lazy('icons/' + favicon),
)))

handler404 = 'judge.views.error.error404'
handler403 = 'judge.views.error.error403'
Expand Down
9 changes: 7 additions & 2 deletions judge/apps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import logging

from django.apps import AppConfig
from django.db import DatabaseError
from django.utils.translation import gettext_lazy

logger = logging.getLogger('judge.apps')


class JudgeAppConfig(AppConfig):
name = 'judge'
Expand All @@ -23,5 +27,6 @@ def ready(self):
# These poor profileless users
profile = Profile(user=user, language=lang)
profile.save()
except DatabaseError:
pass
logger.info('Created profile for user %s', user)
except DatabaseError as e:
logger.error('Failed to create profiles for users: %s', e.__traceback__)
2 changes: 2 additions & 0 deletions judge/contest_format/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from judge.contest_format.atcoder import AtCoderContestFormat
from judge.contest_format.bonuses import BonusesContestFormat
from judge.contest_format.default import DefaultContestFormat
from judge.contest_format.ecoo import ECOOContestFormat
from judge.contest_format.icpc import ICPCContestFormat
from judge.contest_format.ics3u import ICS3UContestFormat
from judge.contest_format.ioi import IOIContestFormat
from judge.contest_format.legacy_ioi import LegacyIOIContestFormat
from judge.contest_format.registry import choices, formats
Loading

0 comments on commit 4c6a985

Please sign in to comment.