~dylanmccall/harvest/gsoc-client-stuff

« back to all changes in this revision

Viewing changes to harvest/opportunities/wrappers.py

  • Committer: Dylan McCall
  • Date: 2010-07-14 20:01:48 UTC
  • Revision ID: dylanmccall@gmail.com-20100714200148-8wh9ejhvrckcbxs0
Quick and dirty fix so opportunity_edit works again.
Changed sourcepackage_detail url to refer to opportunities_package_details instead, which is a similar url that currently exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    """
49
49
    
50
50
    def __init__(self, request, packages_list, opportunities_list):
51
 
        expand_list = list() #list of packages to show in detail
52
 
        if 'expand_pkg' in request.GET:
 
51
        expand_list = None #list of packages to show in detail
 
52
        if 'expand_pkg' in request.GET and request.GET['expand_pkg']:
53
53
            expand_list = request.GET['expand_pkg'].split(',')
54
 
            expand_list = [int(i) for i in expand_list if i.isdigit()]
 
54
            expand_list = [int(i) for i in expand_list]
55
55
        
56
56
        related_packages = set(opportunities_list.values_list('sourcepackage', flat=True))
57
57
        
65
65
                opps = None
66
66
                expand = False
67
67
                
68
 
                expand = (package.id in expand_list)
 
68
                if expand_list: expand = (package.id in expand_list)
69
69
                opps = opportunities_list.filter(sourcepackage=package)
70
70
                
71
71
                package_wrapper = PackageWrapper(request, package,
88
88
        """
89
89
        Returns list of packages that have been hidden from view.
90
90
        """
91
 
        return self.hidden_packages_list
 
91
        return self.hidden_packages_list
 
 
b'\\ No newline at end of file'