Logo
Explore Help
Sign In
darkhelm/notifications-admin
1
0
Fork 0
You've already forked notifications-admin
mirror of https://github.com/GSA/notifications-admin.git synced 2026-06-02 04:20:34 -04:00
Code Issues Packages Projects Releases Wiki Activity
Files
047fb943dbca5aa3ecbbee48fe10d3887484b61c
notifications-admin/app/notify_client/__init__.py

9 lines
149 B
Python
Raw Normal View History

Add created_by to all appropriate requests.
2016-04-15 11:08:19 +01:00
from flask.ext.login import current_user
def _attach_current_user(data):
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 14:20:43 +01:00
return dict(
created_by=current_user.id,
**data
)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.0 Page: 4080ms Template: 70ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API