Пример #1
0
 def is_watching(self):
     """
     Determine if the current user is watching this task or not.
     """
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     return watchers.isWatching()
Пример #2
0
 def is_watching(self):
     site_url = api.portal.get().absolute_url()
     referrer = self.request.environ.get('HTTP_REFERER')
     if referrer:
         if referrer.startswith(site_url + '/'):
             alsoProvides(self.request, IDisableCSRFProtection)
     else:
         origin = self.request.environ.get('HTTP_ORIGIN')
         if origin and origin == site_url:
             alsoProvides(self.request, IDisableCSRFProtection)
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     if watchers:
         return watchers.isWatching()
     return False
Пример #3
0
 def is_watching(self):
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     return watchers.isWatching()
Пример #4
0
 def is_watching(self):
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     return watchers.isWatching()