mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Merge branch 'atomicity' into 'beta'
Atomicité See merge request bde/nk20!122
This commit is contained in:
@ -8,6 +8,7 @@ from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import transaction
|
||||
from django.forms import CheckboxSelectMultiple
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
@ -57,6 +58,7 @@ class ProfileForm(forms.ModelForm):
|
||||
self.fields['address'].widget.attrs.update({"placeholder": "4 avenue des Sciences, 91190 GIF-SUR-YVETTE"})
|
||||
self.fields['promotion'].widget.attrs.update({"max": timezone.now().year})
|
||||
|
||||
@transaction.atomic
|
||||
def save(self, commit=True):
|
||||
if not self.instance.section or (("department" in self.changed_data
|
||||
or "promotion" in self.changed_data) and "section" not in self.changed_data):
|
||||
|
Reference in New Issue
Block a user