Commit 71506912 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

feeds.py: Change last_modified to SQLAlchemy

Change the last_modified check to SQLAlchemy so it works with SQLite
too.
parent 2f555364
......@@ -47,9 +47,10 @@ def write(self, outfile, encoding):
def package_last_modified(request, *args, **kwargs):
cursor = connection.cursor()
cursor.execute("SELECT MAX(last_update) FROM packages")
return cursor.fetchone()[0]
try:
return Package.objects.latest('last_update').last_update
except ObjectDoesNotExist:
return
class PackageFeed(Feed):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment