# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django import forms
+from constance import config
+from django.contrib.sites.models import Site
+from django.core.mail import send_mail
+
from .models import Organization, UserCard, countries
model = Organization
exclude = ['_html']
+ def save(self, commit=True):
+ organization = super(OrganizationForm, self).save(commit=commit)
+ site = Site.objects.get_current()
+ send_mail(
+ 'New organization in MIL/PEER',
+ '''New organization in MIL/PEER: %s. View their profile: https://%s%s.
+
+--
+MIL/PEER team.''' % (organization.name, site.domain, organization.get_absolute_url()),
+ 'milpeer@mdrn.pl', [config.NOTIFY_EMAIL])
+ return organization
+
class UserCardForm(forms.ModelForm):
cts = countries