Commit 6ba32625 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added 'jobExists()' method.

parent 3168f31e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -93,6 +93,16 @@ class DbConnector(object):

    ##### Job #####
    
    def jobExists(self, jobId):
        """Checks if a job already exists. Returns a boolean."""
        if self.conn:
            self.cursor.execute("SELECT * FROM job WHERE job_id = %s;", (jobId,))
            result = self.cursor.fetchall()
            if result:
                return True
            else:
                return False

    def getJob(self, jobId):
        """Returns a JSON object containing job information, according to the job id."""
        if self.conn: