拍爱

views.py 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # -*- coding: utf-8 -*-
  2. from django.shortcuts import render
  3. from account.models import LensmanInfo, TourGuideInfo
  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. })
  18. def lensman_price(request):
  19. return render(request, 'page/lensman_price.html', {})
  20. def tourguide_oauth(request):
  21. unionid = request.GET.get('unionid', '')
  22. try:
  23. tourguide = TourGuideInfo.objects.get(unionid=unionid)
  24. except TourGuideInfo.DoesNotExist:
  25. tourguide = None
  26. return render(request, 'page/tourguide_oauth.html', {
  27. 'tourguide_info': tourguide and tourguide.data,
  28. 'modified': bool((not tourguide) or (tourguide and tourguide.user_status in [TourGuideInfo.UNVERIFIED, TourGuideInfo.REFUSED])), # 是否可以更改信息
  29. })