Skip to content

Commit

Permalink
Merge pull request #730 from MAKENTNU/dev
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
Gunvor4 authored May 10, 2024
2 parents a90ac79 + 4d85a53 commit a4de522
Show file tree
Hide file tree
Showing 29 changed files with 179 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_reusable_add-content-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.MAKE_BOT_APP_ID }}
private_key: ${{ secrets.MAKE_BOT_APP_PEM }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install System Dependencies
# Retries installing files 3 times, as the GitHub Actions CI is occasionally unreliable
Expand All @@ -44,7 +44,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -58,7 +58,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -71,6 +71,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/label-deployment-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.MAKE_BOT_APP_ID }}
private_key: ${{ secrets.MAKE_BOT_APP_PEM }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
python-version: [ "3.10", "3.11" ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,23 @@ A summary of changes made to the codebase, grouped per deployment.

### Other changes

-
-


## 2024-05-10 ([#730](https://github.com/MAKENTNU/web/pull/730))

### New features

- The apply button in the English header, which previously read "søk verv", has now been translated to English ("apply to MAKE")

### Fixes

- The Discord username field in the internal site's member form no longer enforces Discord's old username format

### Other changes

- Updated Django to 5.0.2
- Updated a ridiculous amount of packages


## 2023-05-10 ([#654](https://github.com/MAKENTNU/web/pull/654))
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ and set the following settings (File → Settings...):
```
1. Install requirements:
* If using Windows, first download the correct wheel for the [`python-ldap`](https://pypi.org/project/python-ldap/) package
from [Christoph Gohlke's page](https://www.lfd.uci.edu/~gohlke/pythonlibs/#_python-ldap)
(linked to by [`python-ldap`'s documentation](https://www.python-ldap.org/en/python-ldap-3.4.0/installing.html#windows))
from [Christoph Gohlke](https://github.com/cgohlke)'s [python-ldap-build repository](https://github.com/cgohlke/python-ldap-build).
and install it:
```shell
pip install [path to .whl file]
Expand Down
36 changes: 18 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Django-related packages
Django==4.1.7
django-hosts==5.2
django-ckeditor==6.5.1
django-cleanup==7.0.0
django-constance[database]==2.9.1
Django==5.0.2
django-hosts==6.0
django-ckeditor==6.7.0
django-cleanup==8.1.0
django-constance==3.1.0
django-decorator-include==3.0
# (See this page for a list of all management commands: https://django-extensions.readthedocs.io/en/latest/command_extensions.html)
django-extensions==3.2.1
django-ical==1.9.1
django-extensions==3.2.3
django-ical==1.9.2
django-multiselectfield==0.1.12
django-phonenumber-field[phonenumbers]==7.1.0
django-simple-history==3.3.0
sorl-thumbnail==12.9.0
django-phonenumber-field[phonenumbers]==7.3.0
django-simple-history==3.5.0
sorl-thumbnail==12.10.0

# Packages related to authentication and other "social" stuff
social-auth-app-django==5.2.0
social-auth-app-django==5.4.1
# This is already a requirement of `social-auth-app-django`, but it's listed here to provide the `openidconnect` extra
# (see https://python-social-auth.readthedocs.io/en/stable/installing.html#using-the-extras-options)
social-auth-core[openidconnect]==4.4.2
# TODO: updated, pre-built Windows wheels might be available after this is resolved: https://github.com/python-ldap/python-ldap/issues/511
python-ldap==3.4.3
# python-ldap wheels are now available via https://github.com/cgohlke/python-ldap-build/releases
python-ldap==3.4.4

# Async-related packages (mainly for sending of emails)
channels[daphne]==4.0.0
channels-redis==4.1.0
channels[daphne]==4.1.0
channels-redis==4.2.0

# Misc. packages
bleach[css]==6.0.0
Pillow==9.5.0
bleach[css]==6.1.0
Pillow==10.3.0
uuid==1.30
XlsxWriter==3.1.0
XlsxWriter==3.2.0
5 changes: 2 additions & 3 deletions src/contentbox/migrations/0008_contentbox_last_modified.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='contentbox',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
5 changes: 2 additions & 3 deletions src/faq/migrations/0003_question_last_modified.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='question',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,13 +14,13 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='committee',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='inheritancegroup',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by Django 3.2.8 on 2021-10-25 18:28

from datetime import datetime
from datetime import datetime, timezone
from django.db import migrations, models
from django.utils.timezone import utc


class Migration(migrations.Migration):
Expand All @@ -15,13 +14,13 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='member',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
migrations.AddField(
model_name='systemaccess',
name='last_modified',
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0).replace(tzinfo=utc), verbose_name='last modified'),
field=models.DateTimeField(auto_now=True, default=datetime.utcfromtimestamp(0), verbose_name='last modified'),
preserve_default=False,
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='member',
name='discord_username',
field=web.modelfields.UnlimitedCharField(blank=True, help_text='The username must include the hashtag and the four digits at the end.', validators=[django.core.validators.RegexValidator(re.compile('^(.+)#([0-9]{4})$'), 'Enter a valid Discord username – including the hashtag and the four digits at the end.')], verbose_name='Discord username'),
field=web.modelfields.UnlimitedCharField(blank=True, verbose_name='Discord username'),
),
migrations.AddField(
model_name='member',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,7 @@ class Migration(migrations.Migration):
(
"discord_username",
web.modelfields.UnlimitedCharField(
blank=True,
help_text="The username must include the hashtag and the four digits at the end.",
validators=[
django.core.validators.RegexValidator(
re.compile("^(.+)#([0-9]{4})$"),
"Enter a valid Discord username – including the hashtag and the four digits at the end.",
)
],
verbose_name="Discord username",
blank=True, verbose_name="Discord username"
),
),
(
Expand Down
5 changes: 2 additions & 3 deletions src/internal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from web.modelfields import UnlimitedCharField
from .modelfields import SemesterField
from .util import date_to_semester, year_to_semester
from .validators import WhitelistedEmailValidator, discord_username_validator
from .validators import WhitelistedEmailValidator


class Member(models.Model):
Expand Down Expand Up @@ -57,8 +57,7 @@ class Member(models.Model):
honorary = models.BooleanField(default=False, verbose_name=_("honorary"))
# Our code shouldn't have to keep track of these services' username length constraints, so we should not limit the length
github_username = UnlimitedCharField(blank=True, verbose_name=_("GitHub username"))
discord_username = UnlimitedCharField(blank=True, validators=[discord_username_validator], verbose_name=_("Discord username"),
help_text=_("The username must include the hashtag and the four digits at the end."))
discord_username = UnlimitedCharField(blank=True, verbose_name=_("Discord username"))
minecraft_username = UnlimitedCharField(blank=True, verbose_name=_("Minecraft username"))
last_modified = models.DateTimeField(auto_now=True, verbose_name=_("last modified"))

Expand Down
7 changes: 0 additions & 7 deletions src/internal/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,3 @@ def validate_semester_float(value):
"%(value)s is not a valid semester float",
params={'value': value},
)


discord_username_regex = re.compile(r'^(.+)#([0-9]{4})$')
discord_username_validator = RegexValidator(
discord_username_regex,
_("Enter a valid Discord username – including the hashtag and the four digits at the end."),
)
Binary file modified src/locale/nb/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit a4de522

Please sign in to comment.