Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 7815:f11c982f01c8
chore(refactor): extract setting of db.tx_source out of if tree
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 17 Mar 2024 00:51:12 -0400 |
| parents | 9adf37c63b56 |
| children | f47b186a2ad9 |
comparison
equal
deleted
inserted
replaced
| 7814:9adf37c63b56 | 7815:f11c982f01c8 |
|---|---|
| 1692 return | 1692 return |
| 1693 | 1693 |
| 1694 # open the database or only set the user | 1694 # open the database or only set the user |
| 1695 if not hasattr(self, 'db'): | 1695 if not hasattr(self, 'db'): |
| 1696 self.db = self.instance.open(username) | 1696 self.db = self.instance.open(username) |
| 1697 self.db.tx_Source = "web" | |
| 1698 elif self.instance.optimize: | 1697 elif self.instance.optimize: |
| 1699 self.db.setCurrentUser(username) | 1698 self.db.setCurrentUser(username) |
| 1700 self.db.tx_Source = "web" | |
| 1701 else: | 1699 else: |
| 1702 self.db.close() | 1700 self.db.close() |
| 1703 self.db = self.instance.open(username) | 1701 self.db = self.instance.open(username) |
| 1704 self.db.tx_Source = "web" | |
| 1705 # The old session API refers to the closed database; | 1702 # The old session API refers to the closed database; |
| 1706 # we can no longer use it. | 1703 # we can no longer use it. |
| 1707 self.session_api = Session(self) | 1704 self.session_api = Session(self) |
| 1705 | |
| 1706 self.db.tx_Source = "web" | |
| 1708 | 1707 |
| 1709 # match designator in URL stripping leading 0's. So: | 1708 # match designator in URL stripping leading 0's. So: |
| 1710 # https://issues.roundup-tracker.org/issue002551190 is the same as | 1709 # https://issues.roundup-tracker.org/issue002551190 is the same as |
| 1711 # https://issues.roundup-tracker.org/issue2551190 | 1710 # https://issues.roundup-tracker.org/issue2551190 |
| 1712 # Note: id's are strings not numbers so "02" != "2" but 02 == 2 | 1711 # Note: id's are strings not numbers so "02" != "2" but 02 == 2 |
