app/soc/views/helper/access.py
changeset 891 3d40190f35b6
parent 890 b3bf833c4580
child 892 c3cdb581ffd2
equal deleted inserted replaced
890:b3bf833c4580 891:3d40190f35b6
    39 from soc.logic import accounts
    39 from soc.logic import accounts
    40 from soc.logic import dicts
    40 from soc.logic import dicts
    41 from soc.logic.models.host import logic as host_logic
    41 from soc.logic.models.host import logic as host_logic
    42 from soc.logic.models.notification import logic as notification_logic
    42 from soc.logic.models.notification import logic as notification_logic
    43 from soc.logic.models.request import logic as request_logic
    43 from soc.logic.models.request import logic as request_logic
       
    44 from soc.logic.models.site import logic as site_logic
    44 from soc.logic.models.user import logic as user_logic
    45 from soc.logic.models.user import logic as user_logic
    45 from soc.views import helper
    46 from soc.views import helper
    46 from soc.views import out_of_band
    47 from soc.views import out_of_band
       
    48 from soc.views.helper import redirects
    47 
    49 
    48 
    50 
    49 DEF_NO_USER_LOGIN_MSG_FMT = ugettext_lazy(
    51 DEF_NO_USER_LOGIN_MSG_FMT = ugettext_lazy(
    50   'Please create <a href="/user/edit">User Profile</a>'
    52   'Please create <a href="/user/edit">User Profile</a>'
    51   ' in order to view this page.')
    53   ' in order to view this page.')
   204     return
   206     return
   205 
   207 
   206   # Would not reach this point of site-wide ToS did not exist, since
   208   # Would not reach this point of site-wide ToS did not exist, since
   207   # agreesToSiteToS() call above always returns True if no ToS is in effect.
   209   # agreesToSiteToS() call above always returns True if no ToS is in effect.
   208   login_msg_fmt = DEF_AGREE_TO_TOS_MSG_FMT % {
   210   login_msg_fmt = DEF_AGREE_TO_TOS_MSG_FMT % {
   209       'tos_link': 'TODO(tlarsen): fix circular import first to make this work'}
   211       'tos_link': redirects.getToSRedirect(site_logic.getSingleton())}
   210 
   212 
   211   raise out_of_band.LoginRequest(message_fmt=login_msg_fmt)
   213   raise out_of_band.LoginRequest(message_fmt=login_msg_fmt)
   212 
   214 
   213 
   215 
   214 def checkIsDeveloper(request, args, kwargs):
   216 def checkIsDeveloper(request, args, kwargs):