Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7852367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:24:05+00:00 2026-06-02T19:24:05+00:00

I am still fighting with formsets and I cant really understand why I am

  • 0

I am still fighting with formsets and I cant really understand why I am getting this error:

u’ManagementForm data is missing or has been tampered with

Thats my code:
Please point out my mistakes and help me with resolving this issue.

@csrf_protect
@transaction.commit_on_success
def signup(request):
    form = NewUserCreationForm()
    doc_form = NewDocRegisterForm()

    SpecialityLicensesFormSet = modelformset_factory(SpecialityLicenses, extra=1, exclude = ('user'))
    formset = SpecialityLicensesFormSet(queryset=SpecialityLicenses.objects.none())

    if request.method == "POST":

        form = NewUserCreationForm(request.POST or None)
        doc_form = NewDocRegisterForm(request.POST or None)
        formset = SpecialityLicensesFormSet(request.POST or None)


        if form.is_valid() and doc_form.is_valid() and formset.is_valid():

            user = form.save()

            doc = doc_form.save(commit=False)
            doc.user = user
            doc.save()



            print formset
            fset = formset.save(commit=False)

            for n in fset:
                n.user = user
                n.save()

            return HttpResponse("Uzytkownik utowrzony")

    return render_to_response("userena/signup_new.html", {'form': form,
                                                          'doc_form': doc_form,
                                                          'spec_form': formset,}, 
                              context_instance=RequestContex

t(request)) 

Template code:

<form action="/en/accounts/doc_register/" method="post">{% csrf_token %}
    {% for field in form %}


    <div>
        {% if field.errors %}
            {{ field.errors|striptags }} |
        {% endif %}

        {{field.label}} | {{ field}}
    </div>


    {% endfor %}

    <hr>


    {% for f in doc_form %}
    <div>
    {% if f.errors %}
    {{f.errors|striptags}} | 
    {% endif %}

    {{f.label}} : {{ f }}
    </div>
    {% endfor %}
    <hr>

    {{ spec_form.management_form }}
    {{ spec_form }}

            <hr>
    <input type="submit" value="Submit"/>
</form>
{% endblock %}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:24:06+00:00Added an answer on June 2, 2026 at 7:24 pm

    you don’t need to do {{ formset.management_form }} if you do {{ formset }}, just if you do

    {{ formset.management_form }}
    {% for form in formset %}
      {{ form }}
    {% endfor %}
    

    try removing the {{ spec_form.management_form }} bit from your template. Look at the third example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Still fighting with templates. In this example, despite the fact that is copied straight
I am still fighting my battle against my low IQ :D This is the
I've been fighting with this for an hour now. I'm parsing an XML-string with
I've been fighting with this for a couple of days and there doesn't seem
I've been fighting with this for a while and reading a lot of docs
I have been fighting with this for days now. I have created my own
Still really struggling with this and appear to be going round in circles. I
Still I couldn't understand completely how these delegate methods are getting called. I have
Still working through JQuery to get data and repopulate portions of a page. Right
Still learning Objective-C / iPhone SDK here. I think I know why this wasn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.