コード例 #1
0
 def _test(self, type, exists):
     Installed.objects.create(user=self.user, addon=self.app,
                              install_type=type)
     if exists:
         eq_(list(purchase_list(self.req, self.user, None)[0].object_list),
             [self.app])
     else:
         assert not purchase_list(self.req, self.user, None)[0].object_list
コード例 #2
0
def user_activity(request, user_id):
    """Shows the user activity page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products, contributions, listing = purchase_list(request, user, None)
    is_admin = acl.action_allowed(request, 'Users', 'Edit')

    collections = Collection.objects.filter(author=user_id)
    user_items = ActivityLog.objects.for_user(user).exclude(
        action__in=amo.LOG_HIDE_DEVELOPER)
    admin_items = ActivityLog.objects.for_user(user).filter(
        action__in=amo.LOG_HIDE_DEVELOPER)
    amo.log(amo.LOG.ADMIN_VIEWED_LOG, request.amo_user, user=user)
    return jingo.render(
        request, 'lookup/user_activity.html', {
            'pager': products,
            'account': user,
            'is_admin': is_admin,
            'listing_filter': listing,
            'collections': collections,
            'contributions': contributions,
            'single': bool(None),
            'user_items': user_items,
            'admin_items': admin_items,
            'show_link': False
        })
コード例 #3
0
ファイル: views.py プロジェクト: vinu76jsr/zamboni
def user_activity(request, user_id):
    """Shows the user activity page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products, contributions, listing = purchase_list(request, user, None)
    is_admin = acl.action_allowed(request, "Users", "Edit")

    collections = Collection.objects.filter(author=user_id)
    user_items = ActivityLog.objects.for_user(user).exclude(action__in=amo.LOG_HIDE_DEVELOPER)
    admin_items = ActivityLog.objects.for_user(user).filter(action__in=amo.LOG_HIDE_DEVELOPER)
    amo.log(amo.LOG.ADMIN_VIEWED_LOG, request.amo_user, user=user)
    return jingo.render(
        request,
        "lookup/user_activity.html",
        {
            "pager": products,
            "account": user,
            "is_admin": is_admin,
            "listing_filter": listing,
            "collections": collections,
            "contributions": contributions,
            "single": bool(None),
            "user_items": user_items,
            "admin_items": admin_items,
            "show_link": False,
        },
    )
コード例 #4
0
 def test_ordering(self):
     self.user.installed_set.create(addon=self.app,
                                    install_type=apps.INSTALL_TYPE_USER)
     app2 = app_factory()
     self.user.installed_set.create(addon=app2,
                                    install_type=apps.INSTALL_TYPE_USER)
     eq_(list(purchase_list(self.req, self.user).object_list),
         [app2, self.app])
コード例 #5
0
ファイル: test_utils_.py プロジェクト: shahbaz17/zamboni
 def test_contribution_installed_same_app(self):
     self.user.installed_set.create(
         webapp=self.app,
         install_type=apps.INSTALL_TYPE_USER)
     self.user.contribution_set.create(
         webapp=self.app,
         type=mkt.CONTRIB_PURCHASE)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #6
0
ファイル: views.py プロジェクト: waseem18/zamboni
def user_purchases(request, user_id):
    """Shows the purchase page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    is_admin = acl.action_allowed(request, 'Users', 'Edit')
    products = purchase_list(request, user)
    return render(request, 'lookup/user_purchases.html',
                  {'pager': products, 'account': user, 'is_admin': is_admin,
                   'single': bool(None), 'show_link': False})
コード例 #7
0
ファイル: test_utils_.py プロジェクト: shahbaz17/zamboni
 def test_ordering(self):
     self.user.installed_set.create(
         webapp=self.app,
         install_type=apps.INSTALL_TYPE_USER)
     app2 = app_factory()
     self.user.installed_set.create(
         webapp=app2,
         install_type=apps.INSTALL_TYPE_USER)
     eq_(list(purchase_list(self.req, self.user).object_list),
         [app2, self.app])
コード例 #8
0
def purchases(request, user_id):
    """Shows the purchase page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products, contributions, listing = purchase_list(request, user, None)
    return jingo.render(request, 'acct_lookup/purchases.html',
                        {'pager': products,
                         'account': user,
                         'listing_filter': listing,
                         'contributions': contributions,
                         'single': bool(None),
                         'show_link': False})
コード例 #9
0
ファイル: views.py プロジェクト: gedex/zamboni
def activity(request, user_id):
    """Shows the user activity page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products, contributions, listing = purchase_list(request, user, None)

    collections = Collection.objects.filter(author=user_id)

    return jingo.render(request, 'acct_lookup/activity.html',
                        {'pager': products,
                         'account': user,
                         'listing_filter': listing,
                         'collections': collections,
                         'contributions': contributions,
                         'single': bool(None),
                         'show_link': False})
コード例 #10
0
ファイル: views.py プロジェクト: canuckistani/zamboni
def purchases(request, user_id):
    """Shows the purchase page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products, contributions, listing = purchase_list(request, user, None)
    return jingo.render(
        request,
        "acct_lookup/purchases.html",
        {
            "pager": products,
            "listing_filter": listing,
            "contributions": contributions,
            "single": bool(None),
            "show_link": False,
        },
    )
コード例 #11
0
ファイル: views.py プロジェクト: waseem18/zamboni
def user_activity(request, user_id):
    """Shows the user activity page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products = purchase_list(request, user)
    is_admin = acl.action_allowed(request, 'Users', 'Edit')

    user_items = ActivityLog.objects.for_user(user).exclude(
        action__in=mkt.LOG_HIDE_DEVELOPER)
    admin_items = ActivityLog.objects.for_user(user).filter(
        action__in=mkt.LOG_HIDE_DEVELOPER)
    mkt.log(mkt.LOG.ADMIN_VIEWED_LOG, request.user, user=user)
    return render(request, 'lookup/user_activity.html',
                  {'pager': products, 'account': user, 'is_admin': is_admin,
                   'single': bool(None),
                   'user_items': user_items, 'admin_items': admin_items,
                   'show_link': False})
コード例 #12
0
def activity(request, user_id):
    """Shows the user activity page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products, contributions, listing = purchase_list(request, user, None)

    collections = Collection.objects.filter(author=user_id)

    return jingo.render(
        request, 'acct_lookup/activity.html', {
            'pager': products,
            'account': user,
            'listing_filter': listing,
            'collections': collections,
            'contributions': contributions,
            'single': bool(None),
            'show_link': False
        })
コード例 #13
0
ファイル: views.py プロジェクト: vinu76jsr/zamboni
def user_purchases(request, user_id):
    """Shows the purchase page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    is_admin = acl.action_allowed(request, "Users", "Edit")
    products, contributions, listing = purchase_list(request, user, None)
    return jingo.render(
        request,
        "lookup/user_purchases.html",
        {
            "pager": products,
            "account": user,
            "is_admin": is_admin,
            "listing_filter": listing,
            "contributions": contributions,
            "single": bool(None),
            "show_link": False,
        },
    )
コード例 #14
0
ファイル: views.py プロジェクト: chrisdavidmills/zamboni
def user_activity(request, user_id):
    """Shows the user activity page for another user."""
    user = get_object_or_404(UserProfile, pk=user_id)
    products, contributions, listing = purchase_list(request, user, None)
    is_admin = acl.action_allowed(request, 'Users', 'Edit')

    collections = Collection.objects.filter(author=user_id)
    user_items = ActivityLog.objects.for_user(user).exclude(
        action__in=amo.LOG_HIDE_DEVELOPER)
    admin_items = ActivityLog.objects.for_user(user).filter(
        action__in=amo.LOG_HIDE_DEVELOPER)
    amo.log(amo.LOG.ADMIN_VIEWED_LOG, request.amo_user, user=user)
    return jingo.render(request, 'lookup/user_activity.html',
                        {'pager': products,
                         'account': user,
                         'is_admin': is_admin,
                         'listing_filter': listing,
                         'collections': collections,
                         'contributions': contributions,
                         'single': bool(None),
                         'user_items': user_items,
                         'admin_items': admin_items,
                         'show_link': False})
コード例 #15
0
ファイル: test_utils_.py プロジェクト: shahbaz17/zamboni
 def test_contribution_purchase(self):
     self.user.contribution_set.create(
         webapp=self.app,
         type=mkt.CONTRIB_PURCHASE)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #16
0
 def test_contribution_installed_same_app(self):
     self.user.installed_set.create(addon=self.app,
                                    install_type=apps.INSTALL_TYPE_USER)
     self.user.contribution_set.create(addon=self.app,
                                       type=mkt.CONTRIB_PURCHASE)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #17
0
 def test_contribution_chargeback(self):
     self.user.contribution_set.create(addon=self.app,
                                       type=mkt.CONTRIB_CHARGEBACK)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #18
0
ファイル: test_utils_.py プロジェクト: shahbaz17/zamboni
 def test_reviewer(self):
     self.user.installed_set.create(
         webapp=self.app,
         install_type=apps.INSTALL_TYPE_REVIEWER)
     eq_(list(purchase_list(self.req, self.user).object_list), [])
コード例 #19
0
 def test_reviewer(self):
     self.user.installed_set.create(addon=self.app,
                                    install_type=apps.INSTALL_TYPE_REVIEWER)
     eq_(list(purchase_list(self.req, self.user).object_list), [])
コード例 #20
0
 def test_developer(self):
     self.user.installed_set.create(
         addon=self.app, install_type=apps.INSTALL_TYPE_DEVELOPER)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #21
0
ファイル: test_utils_.py プロジェクト: shahbaz17/zamboni
 def test_contribution_refund(self):
     self.user.contribution_set.create(
         webapp=self.app,
         type=mkt.CONTRIB_REFUND)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #22
0
ファイル: test_utils_.py プロジェクト: shahbaz17/zamboni
 def test_contribution_chargeback(self):
     self.user.contribution_set.create(
         webapp=self.app,
         type=mkt.CONTRIB_CHARGEBACK)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #23
0
ファイル: test_utils_.py プロジェクト: Fjoerfoks/zamboni
 def test_user(self):
     self.user.installed_set.create(
         addon=self.app,
         install_type=apps.INSTALL_TYPE_USER)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #24
0
 def test_contribution_purchase(self):
     self.user.contribution_set.create(addon=self.app,
                                       type=mkt.CONTRIB_PURCHASE)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #25
0
 def test_contribution_refund(self):
     self.user.contribution_set.create(addon=self.app,
                                       type=mkt.CONTRIB_REFUND)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
コード例 #26
0
ファイル: test_utils_.py プロジェクト: shahbaz17/zamboni
 def test_developer(self):
     self.user.installed_set.create(
         webapp=self.app,
         install_type=apps.INSTALL_TYPE_DEVELOPER)
     eq_(list(purchase_list(self.req, self.user).object_list), [self.app])