reg/views.py
changeset 55 53ff84c9192d
parent 54 345d4413b85c
child 57 d321a507fc26
equal deleted inserted replaced
54:345d4413b85c 55:53ff84c9192d
    11 
    11 
    12 from workshop.reg.models import Event, Profile
    12 from workshop.reg.models import Event, Profile
    13 from workshop.reg import forms as reg_forms
    13 from workshop.reg import forms as reg_forms
    14 from workshop.reg import events as reg_events
    14 from workshop.reg import events as reg_events
    15 
    15 
    16 from workshop.feedback.models import Feedback
    16 from workshop.feedback.models import Feedback, FeedLog
    17 
    17 
    18 def homepage(request):
    18 def homepage(request):
    19     """ see if the user is active.
    19     """ see if the user is active.
    20     If not, only show the re send activation email link.
    20     If not, only show the re send activation email link.
    21     else show all the options in homepage.
    21     else show all the options in homepage.
   197     is_org = True if user in event.organizers.all() else False
   197     is_org = True if user in event.organizers.all() else False
   198 
   198 
   199     can_submit_feedback = False
   199     can_submit_feedback = False
   200     if not event.feedback_status == "0":
   200     if not event.feedback_status == "0":
   201         try:
   201         try:
   202             event.feedback.get(user_ip__iexact=user_ip, day=event.feedback_status)
   202             FeedLog.objects.get(user=user,event=event,day=event.feedback_status)
   203         except Feedback.DoesNotExist:
   203         except FeedLog.DoesNotExist:
   204             can_submit_feedback = True 
   204             can_submit_feedback = True 
   205 
   205 
   206     context = {'user': user,
   206     context = {'user': user,
   207                'is_guest': is_guest,
   207                'is_guest': is_guest,
   208                'event': event,
   208                'event': event,