Skip to content

Commit

Permalink
Relevant bug fix
Browse files Browse the repository at this point in the history
- Fixed a problem where if we opened the License Page of a perpetual license (zero timestamp), the license would become expired.
  • Loading branch information
daniel-s-goncalves committed Jul 5, 2022
1 parent 55c797f commit 5f6af34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions bin/databaseAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def applyExpirationState(keyid):
keyObject = getKeyData(keyid)
keyObject.status = 3
db.session.commit()
return keyObject

"""
//////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 2 additions & 3 deletions bin/handlers/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ def displayLicense(licenseID):

try:
license = DBAPI.getKeyAndClient(licenseID)
if(license.status != 3 and license.expirydate < int(time())):
print("Expiring key ...")
DBAPI.applyExpirationState(license.id)
if(license.expirydate != 0 and license.status != 3 and license.expirydate < int(time())):
license = DBAPI.applyExpirationState(license.id)
changelog = DBAPI.getKeyLogs(licenseID)
changelog.reverse()
devices = DBAPI.getKeyHWIDs(licenseID)
Expand Down

0 comments on commit 5f6af34

Please sign in to comment.