forked from beba/foerderbarometer
use walrus operator for user session check
This commit is contained in:
parent
238c674517
commit
a239922e14
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue