use walrus operator for user session check

This commit is contained in:
Roman 2025-09-01 13:33:17 +02:00
parent 238c674517
commit a239922e14
1 changed files with 1 additions and 2 deletions

View File

@ -154,8 +154,7 @@ class BaseApplicationView(FormView):
modell = form.save(commit=False) modell = form.save(commit=False)
# Username from session if present # Username from session if present
user = self.request.session.get('user') if user := self.request.session.get('user'):
if user:
modell.username = user.get('username') modell.username = user.get('username')
# Copy common fields if provided by the form # Copy common fields if provided by the form