from django.forms import Form

from servala.core.models.user import User


class ServalaSignupForm(Form):
    company = User._meta.get_field("company").formfield()

    def signup(self, request, user):
        user.company = self.cleaned_data.get("company")
        user.save()
