示例#1
0
 def make_client(self, request, queryset):
     from pythonpro.domain import user_facade
     for user in queryset:
         try:
             user_facade.promote_client(user, 'django_admin')
         except UserRoleException:
             pass  # No need to handle on admin
示例#2
0
def _promote(user, slug):
    if 'pytools' in slug:
        user_facade.promote_client(user, 'unknow')
    elif 'membership' in slug:
        user_facade.promote_member(user, 'unknow')
    else:
        raise ValueError(f'{slug} should contain pytools or membership')
示例#3
0
def _promote_client(user, request):
    user_facade.promote_client(user,
                               source=request.GET.get('utm_source',
                                                      default='unknown'))
示例#4
0
 def make_client(self, request, queryset):
     from pythonpro.domain import user_facade
     for user in queryset:
         user_facade.promote_client(user, 'django_admin')