예제 #1
0
 def purchase_code(self, box):
     """ Modify the database to reflect purchase """
     team = self.get_current_user().team
     source_code = SourceCode.by_box_id(box.id)
     team.money -= abs(source_code.price)
     team.purchased_source_code.append(source_code)
     logging.info("%s purchased '%s' from the source code market." %
                  (team.name, source_code.file_name))
     self.dbsession.add(team)
     self.dbsession.commit()
예제 #2
0
 def purchase_code(self, box):
     ''' Modify the database to reflect purchase '''
     team = self.get_current_user().team
     source_code = SourceCode.by_box_id(box.id)
     team.money -= abs(source_code.price)
     team.purchased_source_code.append(source_code)
     logging.info("%s purchased '%s' from the source code market." % (
         team.name, source_code.file_name,
     ))
     self.dbsession.add(team)
     self.dbsession.commit()
예제 #3
0
파일: Box.py 프로젝트: x0xr00t/RootTheBox
 def source_code(self):
     return SourceCode.by_box_id(self.id)
예제 #4
0
 def source_code(self):
     return SourceCode.by_box_id(self.id)