Commit a7d0b5eb authored by BAIRE Anthony's avatar BAIRE Anthony

Revert "a new method for webapp to get the tuple status (id,string) of the state of webapp."

This reverts commit af9b6351.

(use django's autogenerated method instead)
parent baf12b9d
......@@ -307,15 +307,6 @@ class Webapp(TimeStampModel):
query = query.filter(number=number)
return query.order_by("-state", "-id").first()
def get_sandbox_state(self):
""""""
for i,s in self.SANDBOX_STATE_CHOICES:
if i == self.sandbox_state:
return i,s
msg = "The current state {} is not defined in the model." \
.format(self.sandbox_state)
raise ValueError(msg)
class WebappParameter(TimeStampModel):
......
......@@ -721,7 +721,7 @@ class WebappSandboxPanel(UserAccessMixin, TemplateView):
messages.success(request, "stopping sandbox %r" % webapp.name)
log.debug("new sandbox state: %r -> %r",
webapp.docker_name, webapp.get_sandbox_state())
webapp.docker_name, webapp.get_sandbox_state_display())
# NOTE: we return a 302 redirect to the same page (instead of rendering
# it directly) to force the browser to make a separate GET request.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment