Upgrade Django from 5.2 to 6.0 (#20).
Align Model.save with keyword-only Django 6 API, fix recaptcha score widget usage, and make Payments.date use a callable default.
This commit is contained in:
+1
-5
@@ -19,11 +19,7 @@ class CaptchaForm(forms.Form):
|
||||
captcha = ReCaptchaField(
|
||||
public_key=settings.RECAPTCHA_PUBLIC_KEY,
|
||||
private_key=settings.RECAPTCHA_PRIVATE_KEY,
|
||||
widget=ReCaptchaV3(
|
||||
attrs={
|
||||
'required_score':0.85,
|
||||
}
|
||||
),
|
||||
widget=ReCaptchaV3(required_score=0.85),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 6.0.7 on 2026-07-14 12:13
|
||||
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('schasite', '0011_alter_payments_date_communitymember_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='payments',
|
||||
name='date',
|
||||
field=models.DateField(default=django.utils.timezone.now),
|
||||
),
|
||||
]
|
||||
+3
-3
@@ -12,13 +12,13 @@ class TimeInfoBase(models.Model):
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
def save(self, **kwargs):
|
||||
if not kwargs.pop("skip_last_modified", False) and not hasattr(self, "skip_last_modified"):
|
||||
self.last_modified = timezone.now()
|
||||
if kwargs.get("update_fields") is not None:
|
||||
kwargs["update_fields"] = list({*kwargs["update_fields"], "last_modified"})
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
super().save(**kwargs)
|
||||
|
||||
# Create your models here.
|
||||
class UsefulLinks(TimeInfoBase):
|
||||
@@ -148,7 +148,7 @@ class MembershipServices(TimeInfoBase):
|
||||
|
||||
|
||||
class Payments(TimeInfoBase):
|
||||
date = models.DateField(default=timezone.now())
|
||||
date = models.DateField(default=timezone.now)
|
||||
status = models.CharField(default="Completed", max_length=256)
|
||||
email = models.EmailField(blank=True, null=True)
|
||||
person = models.ForeignKey(
|
||||
|
||||
Reference in New Issue
Block a user