def put(self, id):
        """**Update a Quest**

        **Example Request:**

        .. sourcecode:: http

             PUT /api/v1/quest/1 HTTP/1.1
             Host: localhost
             Content-Type: application/json

             {
                 "description": "New desc",
                 "creator": "tammy"
             }

        **Example response:**

        .. sourcecode:: http

            HTTP/1.1 200 OK
            Content-Type: application/json

            {
                "status": "ok",
                "id": 1,
                "href": "/api/v1/quests/1",
                "creator": "tammy",
                "embarkTime": timestamp,
                "targetTime": timestamp,
                "completionTime": timestamp,
                "description": "New desc",
                "labors": [],
            }

        :param id: id of the Quest that should be updated.
        :type id: string

        :reqjson string description: the new description of the Quest
        :reqjson string creator: The new username of the creator (owner)
        :regjson timestamp targetTime: Set a new targetTime

        :reqheader Content-Type: The server expects a json body specified with
                                 this header.

        :statuscode 200: The request was successful.
        :statuscode 400: The request was malformed.
        :statuscode 401: The request was made without being logged in.
        :statuscode 403: The request was made with insufficient permissions.
        :statuscode 404: The Quest was not found.
        :statuscode 409: There was a conflict with another resource.
        """

        log.info("QUEST: Updating {}".format(id))

        quest = self.session.query(Quest).filter_by(id=id).scalar()

        if not quest:
            raise exc.NotFound("No such Quest {} found".format(id))

        new_desc = None
        new_creator = None
        new_target_time = None
        try:
            if self.jbody in "description":
                new_desc = self.jbody["description"]
            if "creator" in self.jbody:
                new_creator = self.jbody['creator']
                if not EMAIL_REGEX.match(new_creator):
                    new_creator += "@" + self.domain
            if "targetTime" in self.jbody:
                new_target_time = parser.parse(
                    self.jbody["targetTime"]
                )
                new_target_time = new_target_time.replace(tzinfo=None)
                if new_target_time <= datetime.utcnow():
                    raise exc.BadRequest(
                        "Quest target date must be in future"
                    )
        except KeyError as err:
            raise exc.BadRequest(
                "Missing Required Argument: {}".format(err.message))

        try:
            if new_desc:
                quest = quest.update(
                    description=new_desc
                )
            if new_creator is not None:
                quest = quest.update(
                    creator=new_creator
                )
            if new_target_time:
                quest = quest.update(
                    target_time=new_target_time
                )

        except IntegrityError as err:
            raise exc.Conflict(str(err.orig))

        json = quest.to_dict(self.href_prefix)

        self.success(json)

        log.info("QUEST [{}]: Updated: {} {} {}".format(
            id,
            "new description {}".format(new_desc) if new_desc else "",
            "new creator {}".format(new_creator) if new_creator else "",
            "new target time {}".format(new_target_time) if new_target_time else ""
        ))
dataset/ETHPy150Open dropbox/hermes/hermes/handlers/api.py/QuestHandler.put/swapped operands of `in`