app/soc/views/models/notification.py
changeset 2076 1cd180cc56c9
parent 1991 3aeda3007467
child 2161 3b5e0e0880cd
equal deleted inserted replaced
2075:c6bdfd560d91 2076:1cd180cc56c9
    27 from django import forms
    27 from django import forms
    28 from django.utils.translation import ugettext
    28 from django.utils.translation import ugettext
    29 
    29 
    30 from soc.logic import cleaning
    30 from soc.logic import cleaning
    31 from soc.logic import dicts
    31 from soc.logic import dicts
    32 from soc.logic import validate
       
    33 from soc.models import notification as notification_model
    32 from soc.models import notification as notification_model
    34 from soc.views import helper
    33 from soc.views import helper
    35 from soc.views import out_of_band
       
    36 from soc.views.helper import access
    34 from soc.views.helper import access
    37 from soc.views.helper import decorators
    35 from soc.views.helper import decorators
    38 from soc.views.helper import lists as list_helper
    36 from soc.views.helper import lists as list_helper
    39 from soc.views.helper import redirects
    37 from soc.views.helper import redirects
    40 from soc.views.models import base
    38 from soc.views.models import base
   107     super(View, self).__init__(params=params)
   105     super(View, self).__init__(params=params)
   108 
   106 
   109   @decorators.merge_params
   107   @decorators.merge_params
   110   @decorators.check_access
   108   @decorators.check_access
   111   def list(self, request, access_type,
   109   def list(self, request, access_type,
   112            page_name=None, params=None, filter=None):
   110            page_name=None, params=None, filter=None, order=None, **kwargs):
   113     """Lists all notifications that the current logged in user has stored.
   111     """Lists all notifications that the current logged in user has stored.
   114 
   112 
   115     for parameters see base.list()
   113     for parameters see base.list()
   116     """
   114     """
   117 
   115 
   161     """
   159     """
   162 
   160 
   163     # get the current user
   161     # get the current user
   164     current_user = user_logic.getForCurrentAccount()
   162     current_user = user_logic.getForCurrentAccount()
   165 
   163 
   166     fields['link_id'] = 't%i' %(int(time.time()*100))
   164     fields['link_id'] = 't%i' % (int(time.time()*100))
   167     fields['scope'] = fields['to_user']
   165     fields['scope'] = fields['to_user']
   168     fields['from_user'] = current_user
   166     fields['from_user'] = current_user
   169     fields['scope_path'] = fields['to_user'].link_id
   167     fields['scope_path'] = fields['to_user'].link_id
   170 
   168 
   171   def _editSeed(self, request, seed):
   169   def _editSeed(self, request, seed):