# -*- coding: utf-8 -*-

from __future__ import division

from django.conf import settings
from django.shortcuts import render

from account.models import SaleclerkInfo


def clerk_info_oauth(request):
    unionid = request.GET.get('unionid', '')

    try:
        clerk = SaleclerkInfo.objects.get(unionid=unionid)
    except SaleclerkInfo.DoesNotExist:
        clerk = None

    return render(request, 'page/clerk_info.html', {
        'domain': settings.DOMAIN,
        'clerk_info': clerk and clerk.data,
    })
