green-dino / SignUp

A simple event registration and sign up tool
0 stars 2 forks source link

Registration has no event. #8

Open green-dino opened 2 months ago

green-dino commented 2 months ago

@ryaustin Exception Type: RelatedObjectDoesNotExist at /register/11/ Exception Value: Registration has no event.

Checked with Django Shell

from event.models import Event from .models import Registration

for registration in Registration.objects.all(): try: print(registration.event) except Event.DoesNotExist: print(f"Orphaned registration: {registration.id}")

Screenshot 2024-09-03 at 5 27 38 PM

Is there something that I need to consider in event_regstration modeling? It seems like it's not making the connection.

ryaustin commented 2 months ago

HI Rye if in the shell and on the frontend the form isn't valid, you may not be passing all required fields to create a valid Registration based on your model design.