From 22a9348f6582c9ef7f95fe084f87bb48f3894778 Mon Sep 17 00:00:00 2001 From: "n.lyubchich" Date: Tue, 21 Jul 2015 14:54:29 +0300 Subject: [PATCH] Fix #63 --- project/admin/utils.py | 7 +++---- requirements.txt | 8 ++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/project/admin/utils.py b/project/admin/utils.py index eac28c7..6df202f 100644 --- a/project/admin/utils.py +++ b/project/admin/utils.py @@ -26,10 +26,9 @@ def __init__(self, *, create_form, update_form=None, model, self.success_url = success_url def _clean_data(self, data): - _data = data - for (k, v) in _data: - if k not in self.model.__dict__: - _data.pop(k, None) + + _data = {k: v for k, v in data.items() if k in self.model.__dict__} + return _data def get(self, entry_id): diff --git a/requirements.txt b/requirements.txt index 1e004e9..ca9975a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ anyjson==0.3.3 billiard==3.3.0.20 blinker==1.3 celery==3.1.18 +coverage==3.7.1 decorator==3.4.2 flake8==2.4.1 Flask==0.10.1 @@ -25,7 +26,12 @@ pep8==1.5.7 phonenumbers==7.0.7 psycopg2==2.6.1 pyflakes==0.8.1 +python-coveralls==2.5.0 pytz==2015.4 +PyYAML==3.11 +redis==2.10.3 +requests==2.7.0 +sh==1.11 six==1.9.0 SQLAlchemy==1.0.6 SQLAlchemy-Utils==0.30.12 @@ -34,5 +40,3 @@ Werkzeug==0.10.4 wheel==0.24.0 WTForms==2.0.2 WTForms-Components==0.9.7 -python-coveralls==2.5.0 -coverage==3.7.1