From a46420e68a07f497e8c98274e9f5cc3c979ebc25 Mon Sep 17 00:00:00 2001 From: Lukas Ferreira Date: Tue, 26 Sep 2017 14:23:57 -0300 Subject: [PATCH] conserta error de base/forms.py para editar autor --- .gitignore | 3 +++ package-lock.json | 24 ++++++++++++++++++++++++ sapl/base/forms.py | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index 3bf1301ec..429873229 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ __pycache__/ # C extensions *.so +# Nodejs +node_modules/ + # Distribution / packaging .Python env/ diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..8bfa7ed8f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,24 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "node": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/node/-/node-8.3.0.tgz", + "integrity": "sha512-RU3iQgXeDBU45dv6BrfDrgTyUjJk1yorN64l0sce+E+2pZzFbRbBicPMBD/hWjo0GSMnA5a+RwFtWwHNDlojaw==", + "requires": { + "node-bin-setup": "1.0.6" + } + }, + "node-bin-setup": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz", + "integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q==" + }, + "nodejs": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/nodejs/-/nodejs-0.0.0.tgz", + "integrity": "sha1-RyL6LhisTrc6Qq4W0B41hKErdTE=" + } + } +} diff --git a/sapl/base/forms.py b/sapl/base/forms.py index 992ce558b..7e64c33cd 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -231,7 +231,7 @@ class AutorForm(ModelForm): if 'status_user' in self.Meta.fields: if self.instance.pk and self.instance.user_id: if getattr( - self.instance.user.username, + self.instance.user, get_user_model().USERNAME_FIELD) != cd['username']: if 'status_user' not in cd or not cd['status_user']: raise ValidationError(