mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-10 21:34:10 -05:00
Mutating dictionaries is gross and doesn’t work as you’d expect. Better to have the function return a new dictionary instead. Means we can be explicit that `created_by` is one of the allowed params when updating a service.
9 lines
149 B
Python
9 lines
149 B
Python
from flask.ext.login import current_user
|
|
|
|
|
|
def _attach_current_user(data):
|
|
return dict(
|
|
created_by=current_user.id,
|
|
**data
|
|
)
|