code: def get_next_action(self, request, application, label, roles):
          
          actions = self.get_actions(request, application, roles)
          if label is None and 'is_applicant' in roles:
              assert application.content_type.model == 'person'
              if application.applicant.has_usable_password():
                  form = forms.PersonVerifyPassword(
                      data=request.POST or None, person=application.applicant)
                  form_type = "verify"
              else:
                  form = forms.PersonSetPassword(
                      data=request.POST or None, person=application.applicant)
                  form_type = "set"
              if request.method == 'POST':
                  if 'cancel' in request.POST:
                      return 'cancel'
                  if form.is_valid():
                      form.save()
                      messages.success(
                          request, 'Password updated. New accounts activated.')
                      for action in actions:
                          if action in request.POST:
                              return action
                      return HttpResponseBadRequest("<h1>Bad Request</h1>")
              return render(
                  template_name='kgapplications/common_password.html',
                  context={
                      'application': application,
                      'form': form,
                      'actions': actions,
                      'roles': roles,
                      'type': form_type
                  },
                  request=request)
          return super(StatePassword, self).get_next_action(request, application, label, roles)
docs: Django view method.