Skip to content

Commit

Permalink
fixed handling of simulation update
Browse files Browse the repository at this point in the history
  • Loading branch information
fccoelho committed Dec 3, 2012
1 parent 356560f commit c9251ec
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions epigrass/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ def get(self,simulation_id):

return self.render_template('sim_view.html',**params)

def post(self):
def post(self,simulation_id):
# if not self.form.validate():
# return self.get()
map = self.request.POST.multi['map'].file.read()
Expand All @@ -1076,19 +1076,22 @@ def post(self):


user_info = models.User.get_by_id(long(self.user_id))
sim = models.Simulation()
sim = models.Simulation.get_by_id(int(simulation_id))
sim.owner = user_info.key
sim.name = self.form.name.data
sim.description = self.form.description.data
# sim.put()
sim.map = map
# sim.put()
sim.epg = epg
if map:
sim.map = map
if epg:
sim.epg = epg
# sim.put()
sim.series = series
# sim.put()
sim.network = network
sim.spread = spread
if series:
sim.series = series
if network:
sim.network = network
if spread:
sim.spread = spread
sim.model = self.form.model.data
sim.put()

Expand Down

0 comments on commit c9251ec

Please sign in to comment.