Skip to content

Commit e4a7d24

Browse files
Merge branch 'develop' into release
2 parents 860db48 + d0fbb8a commit e4a7d24

File tree

82 files changed

+1515
-1433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1515
-1433
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim
1+
FROM python:3.10-slim
22
LABEL maintainer="ACM at FSU <contact@fsu.acm.org>"
33

44
ENV PYTHONUNBUFFERED 1
@@ -11,6 +11,8 @@ RUN apt-get update \
1111
&& apt-get install -y --no-install-recommends build-essential \
1212
# Translations dependencies
1313
&& apt-get install -y gettext \
14+
# mysqlclient dependency
15+
&& apt-get install -y pkg-config \
1416
# MariaDB dependency
1517
&& apt-get install -y libmariadb-dev \
1618
# cleaning up unused files

Pipfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
Django = ">=4,<4.2"
8-
mysqlclient = "*"
9-
redis = ">=3"
7+
Django = ">=4.2,<4.3"
8+
mysqlclient = ">=1.4.3"
9+
redis = ">=3.4.0"
1010
hiredis = "*"
1111
django-import-export = "*"
1212
celery = "*"
@@ -20,8 +20,6 @@ channels = "*"
2020
flower = "*"
2121

2222
[dev-packages]
23-
pylint = "*"
24-
autopep8 = "*"
2523

2624
[requires]
27-
python_version = "3.9"
25+
python_version = "3.10"

Pipfile.lock

Lines changed: 489 additions & 692 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/prod/contestsuite/config/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ server {
1313

1414
location = /apple-touch-icon.png {
1515
access_log off;
16-
return 301 $scheme://$server_name/static/core/img/favicons$request_uri;
16+
return 301 $scheme://$server_name/static/favicons$request_uri;
1717
}
1818

1919
location = /favicon.ico {
2020
access_log off;
21-
return 301 $scheme://$server_name/static/core/img/favicons$request_uri;
21+
return 301 $scheme://$server_name/static/favicons$request_uri;
2222
}
2323

2424
location = /robots.txt {

deploy/prod/contestsuite/docker-stack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ services:
217217
FLOWER_COOKIE_KEY: /run/secrets/contestsuite_flower_cookie_key
218218
volumes:
219219
- django_static:/app/static
220-
- flower_static:/usr/local/lib/python3.9/site-packages/flower/static
220+
- flower_static:/usr/local/lib/python3.10/site-packages/flower/static
221221
networks:
222222
- nginx-backend
223223
- db-backend

requirements-dev.txt

Lines changed: 49 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,61 @@
11
-i https://pypi.python.org/simple
2-
astroid==2.14.2 ; python_full_version >= '3.7.2'
3-
autopep8==2.0.1
4-
dill==0.3.6 ; python_version < '3.11'
5-
isort==5.12.0 ; python_full_version >= '3.8.0'
6-
lazy-object-proxy==1.9.0 ; python_version >= '3.7'
7-
mccabe==0.7.0 ; python_version >= '3.6'
8-
platformdirs==3.0.0 ; python_version >= '3.7'
9-
pycodestyle==2.10.0 ; python_version >= '3.6'
10-
pylint==2.16.2
11-
tomli==2.0.1 ; python_version < '3.11'
12-
tomlkit==0.11.6 ; python_version >= '3.6'
13-
typing-extensions==4.5.0 ; python_version >= '3.7'
14-
wrapt==1.14.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
15-
aiohttp==3.7.4.post0 ; python_version >= '3.6'
16-
amqp==5.1.1 ; python_version >= '3.6'
17-
asgiref==3.6.0 ; python_version >= '3.7'
18-
async-timeout==3.0.1 ; python_full_version >= '3.5.3'
19-
attrs==22.2.0 ; python_version >= '3.6'
20-
billiard==3.6.4.0
21-
celery==5.2.7
22-
certifi==2022.12.7 ; python_version >= '3.6'
2+
aiohttp==3.7.4.post0; python_version >= '3.6'
3+
amqp==5.1.1; python_version >= '3.6'
4+
asgiref==3.7.2; python_version >= '3.7'
5+
async-timeout==3.0.1; python_full_version >= '3.5.3'
6+
attrs==23.1.0; python_version >= '3.7'
7+
billiard==4.1.0; python_version >= '3.7'
8+
celery==5.3.1
9+
certifi==2023.7.22; python_version >= '3.6'
2310
channels==4.0.0
24-
chardet==4.0.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
25-
charset-normalizer==3.0.1 ; python_full_version >= '3.6.0'
26-
click==8.1.3 ; python_version >= '3.7'
27-
click-didyoumean==0.3.0 ; python_full_version >= '3.6.2' and python_full_version < '4.0.0'
11+
chardet==4.0.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
12+
charset-normalizer==3.2.0; python_full_version >= '3.7.0'
13+
click==8.1.7; python_version >= '3.7'
14+
click-didyoumean==0.3.0; python_full_version >= '3.6.2' and python_full_version < '4.0.0'
2815
click-plugins==1.1.1
29-
click-repl==0.2.0
30-
defusedxml==0.7.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
31-
deprecated==1.2.13 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
32-
diff-match-patch==20200713 ; python_version >= '2.7'
16+
click-repl==0.3.0; python_version >= '3.6'
17+
cron-descriptor==1.4.0
18+
defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
19+
deprecated==1.2.14; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
20+
diff-match-patch==20230430; python_version >= '3.7'
3321
discord.py==1.7.3
34-
django==4.1.7
35-
django-celery-beat==2.4.0
22+
django==4.2.4
23+
django-celery-beat==2.5.0
3624
django-hashid-field==3.3.7
37-
django-import-export==3.0.2
38-
django-timezone-field==5.0 ; python_version >= '3.7' and python_version < '4.0'
39-
et-xmlfile==1.1.0 ; python_version >= '3.6'
40-
flower==1.2.0
41-
gunicorn==20.1.0
42-
hashids==1.3.1 ; python_version >= '2.7'
43-
hiredis==2.2.2
44-
humanize==4.6.0 ; python_version >= '3.7'
45-
idna==3.4 ; python_version >= '3.5'
46-
kombu==5.2.4 ; python_version >= '3.7'
25+
django-import-export==3.2.0
26+
django-timezone-field==6.0; python_version >= '3.8' and python_version < '4.0'
27+
et-xmlfile==1.1.0; python_version >= '3.6'
28+
flower==2.0.1
29+
gunicorn==21.2.0
30+
hashids==1.3.1; python_version >= '2.7'
31+
hiredis==2.2.3
32+
humanize==4.8.0; python_version >= '3.8'
33+
idna==3.4; python_version >= '3.5'
34+
kombu==5.3.1; python_version >= '3.8'
4735
markuppy==1.14
48-
multidict==6.0.4 ; python_version >= '3.7'
49-
mysqlclient==2.1.1
36+
multidict==6.0.4; python_version >= '3.7'
37+
mysqlclient==2.2.0
5038
odfpy==1.4.1
51-
openpyxl==3.1.1
52-
packaging==23.0 ; python_version >= '3.7'
53-
prometheus-client==0.16.0 ; python_version >= '3.6'
54-
prompt-toolkit==3.0.36 ; python_full_version >= '3.6.2'
55-
python-crontab==2.7.1
56-
python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
57-
pytz==2022.7.1
58-
pyyaml==6.0
39+
openpyxl==3.1.2
40+
packaging==23.1; python_version >= '3.7'
41+
prometheus-client==0.17.1; python_version >= '3.6'
42+
prompt-toolkit==3.0.39; python_full_version >= '3.7.0'
43+
python-crontab==3.0.0
44+
python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
45+
pytz==2023.3
46+
pyyaml==6.0.1
5947
redis==4.1.4
60-
requests==2.28.2
61-
setuptools==67.3.2 ; python_version >= '3.7'
48+
requests==2.31.0
6249
six==1.16.0
63-
sqlparse==0.4.3 ; python_version >= '3.5'
64-
tablib[html,ods,xls,xlsx,yaml]==3.3.0 ; python_version >= '3.7'
65-
tornado==6.2 ; python_version >= '3.7'
66-
tzdata==2022.7 ; python_version >= '2'
67-
urllib3==1.26.14 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
68-
vine==5.0.0 ; python_version >= '3.6'
50+
sqlparse==0.4.4; python_version >= '3.5'
51+
tablib[html,ods,xls,xlsx,yaml]==3.5.0; python_version >= '3.8'
52+
tornado==6.3.3; python_version >= '3.8'
53+
typing-extensions==4.7.1; python_version >= '3.7'
54+
tzdata==2023.3; python_version >= '2'
55+
urllib3==2.0.4; python_version >= '3.7'
56+
vine==5.0.0; python_version >= '3.6'
6957
wcwidth==0.2.6
58+
wrapt==1.15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
7059
xlrd==2.0.1
7160
xlwt==1.3.0
72-
yarl==1.8.2 ; python_version >= '3.7'
61+
yarl==1.9.2; python_version >= '3.7'

requirements.txt

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
-i https://pypi.python.org/simple
2-
aiohttp==3.7.4.post0 ; python_version >= '3.6'
3-
amqp==5.1.1 ; python_version >= '3.6'
4-
asgiref==3.6.0 ; python_version >= '3.7'
5-
async-timeout==3.0.1 ; python_full_version >= '3.5.3'
6-
attrs==22.2.0 ; python_version >= '3.6'
7-
billiard==3.6.4.0
8-
celery==5.2.7
9-
certifi==2022.12.7 ; python_version >= '3.6'
2+
aiohttp==3.7.4.post0; python_version >= '3.6'
3+
amqp==5.1.1; python_version >= '3.6'
4+
asgiref==3.7.2; python_version >= '3.7'
5+
async-timeout==3.0.1; python_full_version >= '3.5.3'
6+
attrs==23.1.0; python_version >= '3.7'
7+
billiard==4.1.0; python_version >= '3.7'
8+
celery==5.3.1
9+
certifi==2023.7.22; python_version >= '3.6'
1010
channels==4.0.0
11-
chardet==4.0.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
12-
charset-normalizer==3.0.1 ; python_full_version >= '3.6.0'
13-
click==8.1.3 ; python_version >= '3.7'
14-
click-didyoumean==0.3.0 ; python_full_version >= '3.6.2' and python_full_version < '4.0.0'
11+
chardet==4.0.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
12+
charset-normalizer==3.2.0; python_full_version >= '3.7.0'
13+
click==8.1.7; python_version >= '3.7'
14+
click-didyoumean==0.3.0; python_full_version >= '3.6.2' and python_full_version < '4.0.0'
1515
click-plugins==1.1.1
16-
click-repl==0.2.0
17-
defusedxml==0.7.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
18-
deprecated==1.2.13 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
19-
diff-match-patch==20200713 ; python_version >= '2.7'
16+
click-repl==0.3.0; python_version >= '3.6'
17+
cron-descriptor==1.4.0
18+
defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
19+
deprecated==1.2.14; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
20+
diff-match-patch==20230430; python_version >= '3.7'
2021
discord.py==1.7.3
21-
django==4.1.7
22-
django-celery-beat==2.4.0
22+
django==4.2.4
23+
django-celery-beat==2.5.0
2324
django-hashid-field==3.3.7
24-
django-import-export==3.0.2
25-
django-timezone-field==5.0 ; python_version >= '3.7' and python_version < '4.0'
26-
et-xmlfile==1.1.0 ; python_version >= '3.6'
27-
flower==1.2.0
28-
gunicorn==20.1.0
29-
hashids==1.3.1 ; python_version >= '2.7'
30-
hiredis==2.2.2
31-
humanize==4.6.0 ; python_version >= '3.7'
32-
idna==3.4 ; python_version >= '3.5'
33-
kombu==5.2.4 ; python_version >= '3.7'
25+
django-import-export==3.2.0
26+
django-timezone-field==6.0; python_version >= '3.8' and python_version < '4.0'
27+
et-xmlfile==1.1.0; python_version >= '3.6'
28+
flower==2.0.1
29+
gunicorn==21.2.0
30+
hashids==1.3.1; python_version >= '2.7'
31+
hiredis==2.2.3
32+
humanize==4.8.0; python_version >= '3.8'
33+
idna==3.4; python_version >= '3.5'
34+
kombu==5.3.1; python_version >= '3.8'
3435
markuppy==1.14
35-
multidict==6.0.4 ; python_version >= '3.7'
36-
mysqlclient==2.1.1
36+
multidict==6.0.4; python_version >= '3.7'
37+
mysqlclient==2.2.0
3738
odfpy==1.4.1
38-
openpyxl==3.1.1
39-
packaging==23.0 ; python_version >= '3.7'
40-
prometheus-client==0.16.0 ; python_version >= '3.6'
41-
prompt-toolkit==3.0.36 ; python_full_version >= '3.6.2'
42-
python-crontab==2.7.1
43-
python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
44-
pytz==2022.7.1
45-
pyyaml==6.0
39+
openpyxl==3.1.2
40+
packaging==23.1; python_version >= '3.7'
41+
prometheus-client==0.17.1; python_version >= '3.6'
42+
prompt-toolkit==3.0.39; python_full_version >= '3.7.0'
43+
python-crontab==3.0.0
44+
python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
45+
pytz==2023.3
46+
pyyaml==6.0.1
4647
redis==4.1.4
47-
requests==2.28.2
48-
setuptools==67.3.2 ; python_version >= '3.7'
48+
requests==2.31.0
4949
six==1.16.0
50-
sqlparse==0.4.3 ; python_version >= '3.5'
51-
tablib[html,ods,xls,xlsx,yaml]==3.3.0 ; python_version >= '3.7'
52-
tornado==6.2 ; python_version >= '3.7'
53-
typing-extensions==4.5.0 ; python_version >= '3.7'
54-
tzdata==2022.7 ; python_version >= '2'
55-
urllib3==1.26.14 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
56-
vine==5.0.0 ; python_version >= '3.6'
50+
sqlparse==0.4.4; python_version >= '3.5'
51+
tablib[html,ods,xls,xlsx,yaml]==3.5.0; python_version >= '3.8'
52+
tornado==6.3.3; python_version >= '3.8'
53+
typing-extensions==4.7.1; python_version >= '3.7'
54+
tzdata==2023.3; python_version >= '2'
55+
urllib3==2.0.4; python_version >= '3.7'
56+
vine==5.0.0; python_version >= '3.6'
5757
wcwidth==0.2.6
58-
wrapt==1.14.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
58+
wrapt==1.15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
5959
xlrd==2.0.1
6060
xlwt==1.3.0
61-
yarl==1.8.2 ; python_version >= '3.7'
61+
yarl==1.9.2; python_version >= '3.7'

src/announcements/tasks.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ def email_annoucement(id):
1919
try:
2020
announcement = Announcement.objects.get(id=id)
2121
except:
22-
logger.info('Failed to send announcement with id %d ' % id)
22+
logger.error(f'Failed to fetch announcement with id {id}')
2323
else:
2424
i=0
2525
users = User.objects.all()
2626
messages = []
2727

28+
# Prepare email per user
29+
# Using seperate message per user to avoid address exposure
2830
for user in users:
2931
if user.is_active and not user.profile.announcement_email_opt_out:
3032
i += 1
@@ -37,21 +39,21 @@ def email_annoucement(id):
3739
messages = tuple(messages)
3840
send_mass_mail(messages, fail_silently=False)
3941

40-
logger.info('Sent announcement to %d users' % i)
42+
logger.info(f'Sent announcement to {i} users')
4143

4244
@shared_task
4345
def discord_announcement(id):
4446
try:
4547
announcement = Announcement.objects.get(id=id)
4648
except:
47-
logger.info('Failed to send announcement with id %d ' % id)
49+
logger.error(f'Failed to fetch announcement with id {id}')
4850
else:
49-
# Initializing webhook
5051
try:
52+
# Initializing webhook
5153
webhook = Webhook.from_url(
5254
ANNOUNCEMENT_WEBHOOK_URL, adapter=RequestsWebhookAdapter())
5355
except InvalidArgument:
54-
logger.info('Failed to connect to announcement webhook')
56+
logger.error('Failed to connect to announcement webhook')
5557
else:
5658
url = 'https://'+ALLOWED_HOSTS[0]+announcement.get_absolute_url()
5759

src/announcements/templates/announcements/announcement_detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends 'core/base.html' %}
1+
{% extends 'base.html' %}
22
{% load cache %}
33
{% load static %}
44

src/announcements/templates/announcements/announcement_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends 'core/base.html' %}
1+
{% extends 'base.html' %}
22
{% load cache %}
33
{% load static %}
44

0 commit comments

Comments
 (0)