# Path: wye/organisations/models.py
# class Organisation(AuditModel):
#     class Meta:
#     def list_user_organisations(cls, user):
#     def get_organisation_user_list(self):
#     def toggle_active(self, logged_user, **kwargs):
#     def __str__(self):


from django import forms
from .models import Organisation, User

    def clean(self):
        user = self.cleaned_data.get('existing_user')
        new_user = self.cleaned_data['new_user']

        if not (user or new_user):
            raise forms.ValidationError(
                'Please choose existing user or add new user')
        return self.cleaned_data


class UserRegistrationForm(forms.ModelForm):
    """
    Form class for completing a user's registration and activating the
    User.

    The class operates on a user model which is assumed to have the required
    fields of a BaseUserModel
    """
    first_name = forms.CharField(max_length=30)
    last_name = forms.CharField(max_length=30)
    password = forms.CharField(max_length=30, widget=forms.PasswordInput)
    password_confirm = forms.CharField(max_length=30,
                                       widget=forms.PasswordInput)

    def __init__(self, *args, **kwargs):
        super(UserRegistrationForm, self).__init__(*args, **kwargs)
        self.initial['username'] = ''

    class Meta:

# Path: wye/organisations/models.py
# class Organisation(AuditModel):
#     class Meta:
#     def list_user_organisations(cls, user):
#     def get_organisation_user_list(self):
#     def toggle_active(self, logged_user, **kwargs):
#     def __str__(self):


# Path: wye/organisations/forms.py
from django import forms
from .models import Organisation, User


    def clean(self):
        user = self.cleaned_data.get('existing_user')
        new_user = self.cleaned_data['new_user']

        if not (user or new_user):
            raise forms.ValidationError(
                'Please choose existing user or add new user')
        return self.cleaned_data


class UserRegistrationForm(forms.ModelForm):
    """
    Form class for completing a user's registration and activating the
    User.

    The class operates on a user model which is assumed to have the required
    fields of a BaseUserModel
    """
    first_name = forms.CharField(max_length=30)
    last_name = forms.CharField(max_length=30)
    password = forms.CharField(max_length=30, widget=forms.PasswordInput)
    password_confirm = forms.CharField(max_length=30,
                                       widget=forms.PasswordInput)

    def __init__(self, *args, **kwargs):
        super(UserRegistrationForm, self).__init__(*args, **kwargs)
        self.initial['username'] = ''

    class Meta:

        model = User