拍爱

views.py 746B

12345678910111213141516171819202122232425262728
  1. # -*- coding: utf-8 -*-
  2. from django.shortcuts import render
  3. from account.models import LensmanInfo
  4. def user_agreement(request):
  5. return render(request, 'page/user_agreement.html', {})
  6. def contact_us(request):
  7. return render(request, 'page/contact_us.html', {})
  8. def lensman_oauth(request):
  9. unionid = request.GET.get('unionid', '')
  10. try:
  11. lensman = LensmanInfo.objects.get(unionid=unionid)
  12. except LensmanInfo.DoesNotExist:
  13. lensman = None
  14. return render(request, 'page/lensman_oauth.html', {
  15. 'lensman_info': lensman and lensman.data,
  16. 'modified': bool((not lensman) or (lensman and lensman.user_status in [LensmanInfo.UNVERIFIED, LensmanInfo.REFUSED])), # 是否可以更改信息
  17. })