Open green-dino opened 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.
if request.method == 'POST':
form = RegistrationForm(request.POST)
form.instance.event = event
@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}")
Is there something that I need to consider in event_regstration modeling? It seems like it's not making the connection.