예제 #1
0
파일: model.py 프로젝트: erinmayhood/osf.io
 def set_folder(self, folder_id, auth):
     self.folder_id = str(folder_id)
     self._update_folder_data()
     self.save()
     # Add log to node
     nodelogger = BoxNodeLogger(node=self.owner, auth=auth)
     nodelogger.log(action="folder_selected", save=True)
예제 #2
0
파일: model.py 프로젝트: GageGaskins/osf.io
 def set_folder(self, folder_id, auth):
     self.folder_id = str(folder_id)
     self._update_folder_data()
     self.save()
     # Add log to node
     nodelogger = BoxNodeLogger(node=self.owner, auth=auth)
     nodelogger.log(action="folder_selected", save=True)
예제 #3
0
파일: model.py 프로젝트: GageGaskins/osf.io
    def set_user_auth(self, user_settings):
        """Import a user's Box authentication and create a NodeLog.

        :param BoxUserSettings user_settings: The user settings to link.
        """
        self.user_settings = user_settings
        nodelogger = BoxNodeLogger(node=self.owner, auth=Auth(user_settings.owner))
        nodelogger.log(action="node_authorized", save=True)
예제 #4
0
파일: model.py 프로젝트: erinmayhood/osf.io
    def set_user_auth(self, user_settings):
        """Import a user's Box authentication and create a NodeLog.

        :param BoxUserSettings user_settings: The user settings to link.
        """
        self.user_settings = user_settings
        nodelogger = BoxNodeLogger(node=self.owner, auth=Auth(user_settings.owner))
        nodelogger.log(action="node_authorized", save=True)
예제 #5
0
파일: model.py 프로젝트: lbanner/osf.io
    def deauthorize(self, auth=None, add_log=True):
        """Remove user authorization from this node and log the event."""
        node = self.owner

        if add_log:
            extra = {'folder_id': self.folder_id}
            nodelogger = BoxNodeLogger(node=node, auth=auth)
            nodelogger.log(action="node_deauthorized", extra=extra, save=True)

        self.folder_id = None
        self.user_settings = None

        self.save()
예제 #6
0
    def deauthorize(self, auth=None, add_log=True):
        """Remove user authorization from this node and log the event."""
        node = self.owner

        if add_log:
            extra = {'folder_id': self.folder_id}
            nodelogger = BoxNodeLogger(node=node, auth=auth)
            nodelogger.log(action="node_deauthorized", extra=extra, save=True)

        self.folder_id = None
        self.user_settings = None

        self.save()
예제 #7
0
    def set_folder(self, folder_id, auth):
        self.folder_id = str(folder_id)
        self._update_folder_data()
        self.save()

        if not self.complete:
            self.user_settings.grant_oauth_access(
                node=self.owner,
                external_account=self.external_account,
                metadata={'folder': self.folder_id})
            self.user_settings.save()

        # Add log to node
        nodelogger = BoxNodeLogger(node=self.owner, auth=auth)
        nodelogger.log(action="folder_selected", save=True)
예제 #8
0
파일: model.py 프로젝트: Alpani/osf.io
    def set_folder(self, folder_id, auth):
        self.folder_id = str(folder_id)
        self._update_folder_data()
        self.save()

        if not self.complete:
            self.user_settings.grant_oauth_access(
                node=self.owner,
                external_account=self.external_account,
                metadata={'folder': self.folder_id}
            )
            self.user_settings.save()

        # Add log to node
        nodelogger = BoxNodeLogger(node=self.owner, auth=auth)
        nodelogger.log(action="folder_selected", save=True)