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
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')
def _promote_client(user, request): user_facade.promote_client(user, source=request.GET.get('utm_source', default='unknown'))
def make_client(self, request, queryset): from pythonpro.domain import user_facade for user in queryset: user_facade.promote_client(user, 'django_admin')