示例#1
0
 def post(self):
     item_id = int(self.get_argument("item_id"))
     timestamp = int(self.get_argument("timestamp"))
     
     context = self._build_common_context()
     deleted = True
     if context['role']['moderator']:
         DATABASE.items_delete_price(item_id, timestamp)
     else:
         if context['rendering']['time_current'] - timestamp > CONFIG['data']['prices']['delete_window']:
             DATABASE.flags_create(item_id, timestamp, context['identity']['user_id'])
             deleted = False
         else:
             DATABASE.items_delete_price(item_id, timestamp, context['identity']['user_id'])
     self.write({'deleted': deleted})
示例#2
0
 def post(self):
     item_id = int(self.get_argument("item_id"))
     timestamp = int(self.get_argument("timestamp"))
     
     context = self._build_common_context()
     if context['role']['moderator']:
         DATABASE.items_delete_price(item_id, timestamp)
     else:
         if context['rendering']['time_current'] - timestamp > CONFIG['data']['prices']['delete_window']:
             DATABASE.flags_create(item_id, timestamp, context['identity']['user_id'])
         else:
             DATABASE.items_delete_price(item_id, timestamp, context['identity']['user_id'])
             
     self.redirect("/items/{item_id}".format(
         item_id=item_id,
     ))
示例#3
0
    def post(self):
        item_id = int(self.get_argument("item_id"))
        timestamp = int(self.get_argument("timestamp"))

        context = self._build_common_context()
        if context['role']['moderator']:
            DATABASE.items_delete_price(item_id, timestamp)
        else:
            if context['rendering']['time_current'] - timestamp > (
                    CONFIG['data']['prices']['delete_days'] * TIME_DAY):
                DATABASE.flags_create(item_id, timestamp,
                                      context['identity']['user_id'])
            else:
                DATABASE.items_delete_price(item_id, timestamp,
                                            context['identity']['user_id'])

        self.redirect("/items/{item_id}".format(item_id=item_id, ))
示例#4
0
    def post(self):
        item_id = int(self.get_argument("item_id"))
        timestamp = int(self.get_argument("timestamp"))

        context = self._build_common_context()
        deleted = True
        if context['role']['moderator']:
            DATABASE.items_delete_price(item_id, timestamp)
        else:
            if context['rendering']['time_current'] - timestamp > (
                    CONFIG['data']['prices']['delete_days'] * TIME_DAY):
                DATABASE.flags_create(item_id, timestamp,
                                      context['identity']['user_id'])
                deleted = False
            else:
                DATABASE.items_delete_price(item_id, timestamp,
                                            context['identity']['user_id'])
        self.write({
            'deleted': deleted,
        })