summaryrefslogtreecommitdiff
path: root/packages/views/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/views/__init__.py')
-rw-r--r--packages/views/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/views/__init__.py b/packages/views/__init__.py
index 573e0c72..e66da179 100644
--- a/packages/views/__init__.py
+++ b/packages/views/__init__.py
@@ -1,10 +1,10 @@
from django.contrib import messages
from django.contrib.auth.decorators import permission_required
+from django.contrib.auth.models import User
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404, redirect
from django.utils import simplejson
-from django.views.decorators.cache import never_cache
from django.views.decorators.http import require_POST
from django.views.decorators.vary import vary_on_headers
from django.views.generic.simple import direct_to_template
@@ -27,7 +27,8 @@ from .signoff import signoffs, signoff_package, signoff_options, signoffs_json
class PackageJSONEncoder(DjangoJSONEncoder):
pkg_attributes = [ 'pkgname', 'pkgbase', 'repo', 'arch', 'pkgver',
'pkgrel', 'epoch', 'pkgdesc', 'url', 'filename', 'compressed_size',
- 'installed_size', 'build_date', 'last_update', 'flag_date' ]
+ 'installed_size', 'build_date', 'last_update', 'flag_date',
+ 'maintainers', 'packager' ]
def default(self, obj):
if hasattr(obj, '__iter__'):
@@ -43,6 +44,8 @@ class PackageJSONEncoder(DjangoJSONEncoder):
return obj.directory + filename
if isinstance(obj, (Repo, Arch, PackageGroup)):
return obj.name.lower()
+ elif isinstance(obj, User):
+ return obj.username
return super(PackageJSONEncoder, self).default(obj)
def opensearch(request):
@@ -244,7 +247,6 @@ def arch_differences(request):
return direct_to_template(request, 'packages/differences.html', context)
@permission_required('main.change_package')
-@never_cache
def stale_relations(request):
relations = PackageRelation.objects.select_related('user')
pkgbases = Package.objects.all().values('pkgbase')