83d8d58b3867b251c1441fc29c7b719036b14f67,apps/domain/src/main/core/services/request_service.py,,update_request_msg,#Any#Any#Any#,208

Before Change


                message="Request status should be either "accepted" or "denied""
            )

        if status == "accepted":
            request = requests.first(id=request_id)
            object_id = request.object_id

            // Accessing and updating the datase metadata
            storage = node.disk_store
            read_permission = {
                "verify_key": verify_key.encode(encoder=HexEncoder).decode("utf-8"),
                "request_id": request_id,
            }

            update_dataset_metadata(key=object_id, read_permissions=read_permission)

        // TODO:
        // 1 - The logic to change a user privacy budget needs to be implemented,
        // as soon as this logic is ready this need to be updated.

        requests.set(request_id=request_id, status=status)
    else:
        raise AuthorizationError("You"re not allowed to update Request information!")

After Change


    _req_owner = _current_user_key == _req.verify_key

    if status == "accepted" and _can_triage_request:
        tmp_obj = node.store[UID.from_string(_req.object_id)]
        tmp_obj.read_permissions[
            VerifyKey(_req.verify_key.encode("utf-8"), encoder=HexEncoder)
        ] = _req.id
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenMined/Grid
Commit Name: 83d8d58b3867b251c1441fc29c7b719036b14f67
Time: 2021-03-30
Author: ionesiojr@gmail.com
File Name: apps/domain/src/main/core/services/request_service.py
Class Name:
Method Name: update_request_msg


Project Name: HewlettPackard/dlcookbook-dlbs
Commit Name: 41d81fe837e4728070d795dc053fce253fcc5d2d
Time: 2019-06-20
Author: sergey.serebryakov@hpe.com
File Name: python/dlbs/processor.py
Class Name: Processor
Method Name: cast_variable


Project Name: developmentseed/label-maker
Commit Name: 83bc0d85df0f9075152631bd81be4e6ddc9e24ca
Time: 2020-05-13
Author: vincent.sarago@gmail.com
File Name: label_maker/utils.py
Class Name:
Method Name: get_tile_wms