def go_public(request, app_uuid): from models import Application, Token, UserGroups app = get_object_or_404(Application, uuid=app_uuid) if not app.public: return HttpResponse(u'Permission deny') if not request.user.get_profile().is_email_confirmed: return HttpResponse(u'Confirm your email or use direct link http://elib.tsogu.ru/') try: ug = UserGroups.objects.get(user=request.user, application=app) except: ug = UserGroups(user=request.user, application=app, groups=u' ') ug.save() return HttpResponseRedirect(u'%s%s'%(app.link,Token.set(request.user,app)))
def go(request, app_uuid): from models import Application, Token app = get_object_or_404(Application, uuid=app_uuid) return HttpResponseRedirect(u'%s%s'%(app.link,Token.set(request.user,app)))