Files
notifications-admin/app/notify_client/__init__.py
Chris Hill-Scott da1fa2e61c Make _attach_current_user a pure function
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.
2016-08-11 17:07:55 +01:00

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
)