Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.12.6"
python-version-file: "pyproject.toml"
cache: "poetry"

- name: Validate lockfile
Expand Down
12 changes: 12 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Release Notes
=============

Version 0.30.3
--------------

- Add custom user model (#2015)
- Update dependency ruff to v0.9.6 (#2033)
- Update dependency @mui/lab to v6.0.0-beta.26 (#2023)
- Remove django-debug-toolbar (#2021)
- Update actions/setup-python to use pyproject.toml (#2020)
- Update actions/setup-python digest to 4237552 (#2022)
- Update dependency stylelint-config-standard-scss to v14 (#2029)
- Update dependency syncpack to v13 (#2030)

Version 0.30.2 (Released February 10, 2025)
--------------

Expand Down
2 changes: 1 addition & 1 deletion frontends/ol-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@emotion/styled": "^11.11.0",
"@mitodl/smoot-design": "^3.0.1",
"@mui/base": "5.0.0-beta.69",
"@mui/lab": "6.0.0-beta.24",
"@mui/lab": "6.0.0-beta.26",
"@mui/material": "^6.4.1",
"@mui/material-nextjs": "^6.3.1",
"@mui/system": "^6.4.1",
Expand Down
2 changes: 1 addition & 1 deletion frontends/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"prettier": "^3.3.3",
"prettier-plugin-django-alpine": "^1.2.6",
"stylelint": "^16.0.0",
"stylelint-config-standard-scss": "^7.0.1",
"stylelint-config-standard-scss": "^14.0.0",
"ts-node": "^10.9.2",
"type-fest": "^4.18.3",
"typescript": "^5.4.3"
Expand Down
12 changes: 3 additions & 9 deletions main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from main.settings_pluggy import * # noqa: F403
from openapi.settings_spectacular import open_spectacular_settings

VERSION = "0.30.2"
VERSION = "0.30.3"

log = logging.getLogger()

Expand Down Expand Up @@ -69,7 +69,7 @@

ALLOWED_HOSTS = ["*"]

AUTH_USER_MODEL = "auth.User"
AUTH_USER_MODEL = "users.User"

SECURE_SSL_REDIRECT = get_bool("MITOL_SECURE_SSL_REDIRECT", True) # noqa: FBT003

Expand Down Expand Up @@ -107,7 +107,7 @@
"drf_spectacular",
# Put our apps after this point
"main",
"users",
"users.apps.UsersConfig",
"authentication",
"channels",
"profiles",
Expand Down Expand Up @@ -690,12 +690,6 @@ def get_all_config_keys():
"main.middleware.feature_flags.CookieFeatureFlagMiddleware",
)

# django debug toolbar only in debug mode
if DEBUG:
INSTALLED_APPS += ("debug_toolbar",)
# it needs to be enabled before other middlewares
MIDDLEWARE = ("debug_toolbar.middleware.DebugToolbarMiddleware", *MIDDLEWARE)

REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",),
"DEFAULT_AUTHENTICATION_CLASSES": (
Expand Down
5 changes: 0 additions & 5 deletions main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,3 @@
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
)

if settings.DEBUG:
import debug_toolbar # pylint: disable=wrong-import-position, wrong-import-order

urlpatterns += [re_path(r"^__debug__/", include(debug_toolbar.urls))]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"packageManager": "yarn@4.6.0",
"devDependencies": {
"syncpack": "^12.4.0"
"syncpack": "^13.0.0"
},
"resolutions": {
"@types/react": "^18",
Expand Down
55 changes: 20 additions & 35 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ django-scim2 = "^0.19.1"
django-oauth-toolkit = "^2.3.0"
youtube-transcript-api = "^0.6.2"
posthog = "^3.5.0"
ruff = "0.9.5"
ruff = "0.9.6"
dateparser = "^1.2.0"
uwsgitop = "^0.12"
pytest-lazy-fixtures = "^1.1.1"
Expand All @@ -97,7 +97,6 @@ deepmerge = "^2.0"
[tool.poetry.group.dev.dependencies]
bpython = "^0.25"
ddt = "^1.6.0"
django-debug-toolbar = "^4.1.0"
factory_boy = "^3.3.0"
faker = "^35.0.0"
ipdb = "^0.13.13"
Expand Down
142 changes: 138 additions & 4 deletions users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,143 @@
# Generated by Django 4.2.18 on 2025-02-05 19:41
# Generated by Django 4.2.18 on 2025-02-05 20:42

from django.db import migrations
import django.contrib.auth.models
import django.contrib.auth.validators
import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = []
initial = True

operations = []
dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
]

operations = [
migrations.CreateModel(
name="User",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("password", models.CharField(max_length=128, verbose_name="password")),
(
"last_login",
models.DateTimeField(
blank=True, null=True, verbose_name="last login"
),
),
(
"is_superuser",
models.BooleanField(
default=False,
help_text=(
"Designates that this user has all permissions without "
"explicitly assigning them."
),
verbose_name="superuser status",
),
),
(
"username",
models.CharField(
error_messages={
"unique": "A user with that username already exists."
},
help_text=(
"Required. 150 characters or fewer. "
"Letters, digits and @/./+/-/_ only."
),
max_length=150,
unique=True,
validators=[
django.contrib.auth.validators.UnicodeUsernameValidator()
],
verbose_name="username",
),
),
(
"first_name",
models.CharField(
blank=True, max_length=150, verbose_name="first name"
),
),
(
"last_name",
models.CharField(
blank=True, max_length=150, verbose_name="last name"
),
),
(
"email",
models.EmailField(
blank=True, max_length=254, verbose_name="email address"
),
),
(
"is_staff",
models.BooleanField(
default=False,
help_text=(
"Designates whether the user can log into this admin site."
),
verbose_name="staff status",
),
),
(
"is_active",
models.BooleanField(
default=True,
help_text=(
"Designates whether this user should be treated as active. "
"Unselect this instead of deleting accounts."
),
verbose_name="active",
),
),
(
"date_joined",
models.DateTimeField(
default=django.utils.timezone.now, verbose_name="date joined"
),
),
(
"groups",
models.ManyToManyField(
blank=True,
help_text=(
"The groups this user belongs to. A user will get all "
"permissions granted to each of their groups."
),
related_name="user_set",
related_query_name="user",
to="auth.group",
verbose_name="groups",
),
),
(
"user_permissions",
models.ManyToManyField(
blank=True,
help_text="Specific permissions for this user.",
related_name="user_set",
related_query_name="user",
to="auth.permission",
verbose_name="user permissions",
),
),
],
options={
"db_table": "auth_user",
},
managers=[
("objects", django.contrib.auth.models.UserManager()),
],
),
]
29 changes: 29 additions & 0 deletions users/migrations/0002_update_user_contenttype.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 4.2.18 on 2025-02-05 22:13

from django.db import migrations


def change_user_type(apps, schema_editor):
"""Update the ContentType for User to point to the custom one"""
ContentType = apps.get_model("contenttypes", "ContentType")
ct = ContentType.objects.filter(app_label="auth", model="user").first()
if ct:
ct.app_label = "users"
ct.save()


def revert_user_type(apps, schema_editor):
"""Update the ContentType for User to point to the default django one"""
ContentType = apps.get_model("contenttypes", "ContentType")
ct = ContentType.objects.filter(app_label="users", model="user").first()
if ct:
ct.app_label = "auth"
ct.save()


class Migration(migrations.Migration):
dependencies = [
("users", "0001_initial"),
]

operations = [migrations.RunPython(change_user_type, revert_user_type)]
10 changes: 10 additions & 0 deletions users/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Users models"""

from django.contrib.auth.models import AbstractUser


class User(AbstractUser):
"""Custom model for users"""

class Meta:
db_table = "auth_user"
Loading
Loading