def get_pub_id_owner(self, pub_id):
        """Check if a user owns a publication"""
        con = self.connection or self._connect()
        cur = con.cursor()

        cur.execute(
            """SELECT distinct username from upload.reaction
            WHERE pub_id = '{pub_id}'"""
            .format(pub_id=pub_id))

        username = cur.fetchall()[0][0]

        return username
def get_pub_id_owner ( self , pub_id ) : con = self . connection or self . _connect ( ) cur = con . cursor ( ) cur . execute ( """SELECT distinct username from upload.reaction
            WHERE pub_id = '{pub_id}'""" . format ( pub_id = pub_id ) ) username = cur . fetchall ( ) [ 0 ] [ 0 ] return username
Check if a user owns a publication