Another bugfix.
This commit is contained in:
parent
fc3b2bd1cc
commit
85cfc171d2
10
egon_no.py
10
egon_no.py
|
@ -238,7 +238,7 @@ class MainWindow(QMainWindow):
|
|||
item = QTableWidgetItem(self.trUtf8("Ferdig"))
|
||||
item.setBackground(QBrush(Qt.green, Qt.SolidPattern))
|
||||
else:
|
||||
done = False
|
||||
done = True
|
||||
item = QTableWidgetItem(self.trUtf8("Ikke ferdig"))
|
||||
item.setBackground(QBrush(Qt.red, Qt.SolidPattern))
|
||||
table.setItem(row, 6, item)
|
||||
|
@ -249,8 +249,9 @@ class MainWindow(QMainWindow):
|
|||
bookTitle = table.item(row, 2).text()
|
||||
book = getBookWithTitleFromDB(bookTitle)
|
||||
bookIsbn = book.getIsbn()
|
||||
chapter = table.item(row, 4).text()
|
||||
updateReadingDone(week, courseCode, bookIsbn, chapter, True)
|
||||
chapter = table.item(row, 3).text()
|
||||
updateReadingDone(week, courseCode, bookIsbn, chapter, done)
|
||||
print week, courseCode, bookIsbn, chapter, done
|
||||
|
||||
## Return the reading table and its current row
|
||||
def getReadingTableAndRow(self):
|
||||
|
@ -1963,6 +1964,7 @@ def updateReadingDone(week, coursecode, bookisbn, chapter, done):
|
|||
|
||||
course = "%s" % coursecode
|
||||
book = "%s" % bookisbn
|
||||
ch = "%s" % chapter
|
||||
|
||||
cursor.execute('''
|
||||
UPDATE Reading
|
||||
|
@ -1971,7 +1973,7 @@ def updateReadingDone(week, coursecode, bookisbn, chapter, done):
|
|||
AND course = ?
|
||||
AND book = ?
|
||||
AND chapter = ?
|
||||
''', (done, week, course, book, chapter))
|
||||
''', (done, week, course, book, ch))
|
||||
|
||||
exitDB(conn)
|
||||
|
||||
|
|
Reference in New Issue