Exemplo n.º 1
0
 def clean_email(self):
     email = self.cleaned_data['email']
     password = self.cleaned_data['password']
     importer = OpenInviter()
     try:
         self.contacts = importer.contacts(email, password)
     except OpenInviterException, e:
         raise forms.ValidationError(e)
Exemplo n.º 2
0
 def clean_email(self):
     email = self.cleaned_data['email']
     password = self.cleaned_data['password']
     importer = OpenInviter()
     try:
         self.contacts = importer.contacts(email, password)
     except OpenInviterException, e:
         raise forms.ValidationError(e)
Exemplo n.º 3
0
    def __init__(self, *args, **kwargs):
        super(FriendImportServiceForm, self).__init__(*args, **kwargs)

        importer = OpenInviter()
        services = importer.services()

        self.fields['service'].choices = []
        for service in services:
            self.fields['service'].choices.append([service, service])
Exemplo n.º 4
0
    def __init__(self, *args, **kwargs):
        super(FriendImportServiceForm, self).__init__(*args, **kwargs)

        importer = OpenInviter()
        services = importer.services()

        self.fields['service'].choices = []
        for service in services:
            self.fields['service'].choices.append([service, service])
Exemplo n.º 5
0
    def is_valid(self, *args, **kwargs):
        if not super(FriendImportForm, self).is_valid(*args, **kwargs):
            return False

        email = self.cleaned_data['email']
        password = self.cleaned_data['password']

        # this check is used in the case that a manual selection of the service
        # is possible in the form. See FriendImportServiceForm for an example
        service = False
        if 'service' in self.cleaned_data:
            service = self.cleaned_data['service']

        importer = OpenInviter()
        try:
            self.contacts = importer.contacts(email, password, service=service)
        except OpenInviterException, e:
            raise forms.ValidationError(e)
Exemplo n.º 6
0
    def is_valid(self, *args, **kwargs):
        if not super(FriendImportForm, self).is_valid(*args, **kwargs):
            return False

        email = self.cleaned_data['email']
        password = self.cleaned_data['password']

        # this check is used in the case that a manual selection of the service 
        # is possible in the form. See FriendImportServiceForm for an example
        service = False
        if 'service' in self.cleaned_data:
            service = self.cleaned_data['service']

        importer = OpenInviter()
        try:
            self.contacts = importer.contacts(email, password, service = service)
        except OpenInviterException, e:
            raise forms.ValidationError(e)