X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/2f9cb34a07fcd98effda2fa900e48c31813f14c8..b103d6f69bec99cbcc3eb2f0509d950f0a1c0642:/apps/organizations/forms.py diff --git a/apps/organizations/forms.py b/apps/organizations/forms.py index 63f9c028..63984486 100644 --- a/apps/organizations/forms.py +++ b/apps/organizations/forms.py @@ -1,6 +1,12 @@ +# -*- coding: utf-8 -*- +# +# This file is part of MIL/PEER, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import forms from .models import Organization, UserCard, countries + class OrganizationForm(forms.ModelForm): cts = countries @@ -8,6 +14,7 @@ class OrganizationForm(forms.ModelForm): model = Organization exclude = ['_html'] + class UserCardForm(forms.ModelForm): cts = countries @@ -24,11 +31,10 @@ class UserCardForm(forms.ModelForm): 'first_name': kwargs['instance'].user.first_name, 'last_name': kwargs['instance'].user.last_name, } - return super(UserCardForm, self).__init__(*args, **kwargs) + super(UserCardForm, self).__init__(*args, **kwargs) def save(self, *args, **kwargs): self.instance.user.first_name = self.cleaned_data.get('first_name', '') self.instance.user.last_name = self.cleaned_data.get('last_name', '') self.instance.user.save() return super(UserCardForm, self).save(*args, **kwargs) -