Hey Guys,

I've got a model like this:

event   = models.ForeignKey(Event)
user            = models.ForeignKey(UserProfile)
user_2  = models.ForeignKey(UserProfile, related_name='user_2')

I then get a list of all the invites:

people_invited = EventInvitation.objects.filter
(event=event).select_related()

And I want to check if a user is not in this list:

user = UserProfile.objects.get(user=request.user.id)
if not user in people_invited:
        return HttpResponseRedirect('/')

Now, the user will be in the user_2 field, not the user field, but the
code above doesn't seem to work properly because even when the user is
in the user_2 field they get redirected :/

Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to