def clean(self):
    cleaned_data = super(AddDatabasesAction, self).clean()
    if cleaned_data.get('user'):
        if (not cleaned_data.get('password')):
            msg = _('You must specify a password if you create a user.')
            self._errors['password'] = self.error_class([msg])
        if (not cleaned_data.get('databases')):
            msg = _('You must specify at least one database if you create a user.')
            self._errors['databases'] = self.error_class([msg])
    return cleaned_data
def clean(self):
    cleaned_data = super(AddDatabasesAction, self).clean()
    if cleaned_data.get('user'):
        if (not cleaned_data.get('password')):
            msg = _('You must specify a password if you create a user.')
            self._errors['password'] = self.error_class([msg])
        if (not cleaned_data.get('databases')):
            msg = _('You must specify at least one database if you create a user.')
            self._errors['databases'] = self.error_class([msg])
    return cleaned_data