diff options
Diffstat (limited to 'gstudio/views')
-rw-r--r-- | gstudio/views/page.py | 8 | ||||
-rw-r--r-- | gstudio/views/video.py | 14 |
2 files changed, 16 insertions, 6 deletions
diff --git a/gstudio/views/page.py b/gstudio/views/page.py index d673f770..e59caec7 100644 --- a/gstudio/views/page.py +++ b/gstudio/views/page.py @@ -39,12 +39,20 @@ def pagedashboard(request,pageid): # # block = request.POST.get("block","") section_del = request.POST.get("del_section", "") comment_del = request.POST.get("del_comment", "") + docid = request.POST.get("docid","") + addtags = request.POST.get("addtags","") + texttags = request.POST.get("texttags","") if section_del: del_section(int(id_no)) if comment_del: del_comment(int(id_no1)) if rating : rate_section(int(id_no),request,int(rating)) + if addtags != "": + i=Gbobject.objects.get(id=docid) + i.tags = i.tags+ ","+str(texttags) + i.save() + if rep : if not id_no : ptitle= make_title(int(id_no)) diff --git a/gstudio/views/video.py b/gstudio/views/video.py index 668e77bc..65e9d43f 100644 --- a/gstudio/views/video.py +++ b/gstudio/views/video.py @@ -60,10 +60,9 @@ def video(request): mapname = request.POST.get("mapname","") wename = request.POST.get("wename","") titlename = request.POST.get("titlename","") - password = request.POST.get("upload","") addtags = request.POST.get("addtags","") texttags = request.POST.get("texttags","") - + password = request.POST.get("videopassword","") if rate == '0': rate = 'No rating yet' else : @@ -120,7 +119,6 @@ def video(request): if clip != "": - userauth = authenticate(username=user, password=password) api.signup({'username':user,'password':password,'email':useremail}) save_file(clip,user) clipname = clip._get_name() @@ -131,7 +129,7 @@ def video(request): i=i+1 y=str(dirname) x=str(clipname[0]).upper() - CreateConfig(user) + CreateConfig(user,password) # os.system("pandora_client config") os.system("pandora_client add_volume "+ user+" "+MEDIA_ROOTNEW+"/"+user ) os.system("pandora_client scan") @@ -146,6 +144,8 @@ def video(request): m.content=content m.status=2 m.save() + m.sites.add(Site.objects.get_current()) + m.save() m.objecttypes.add(Objecttype.objects.get(id=p.id)) m.save() a=Attribute() @@ -235,6 +235,8 @@ def video(request): m.content=content m.status=2 m.save() + m.sites.add(Site.objects.get_current()) + m.save() m.objecttypes.add(Objecttype.objects.get(id=p.id)) m.save() a=Attribute() @@ -322,10 +324,10 @@ def sort_video(video): -def CreateConfig(user): +def CreateConfig(user,password): myfile = open(VIDEO_PANDORA_URL,'w') myfile = open(VIDEO_PANDORA_URL,'a') - myfile.write('{ \n "username":"'+user+'", \n "url":"http://wetube.gnowledge.org/api/",\n"cache": "~/.ox/client.sqlite",\n"media-cache": "~/.ox/media",\n"volumes":{},\n"password":"wetube"\n }') + myfile.write('{ \n "username":"'+user+'", \n "url":"http://wetube.gnowledge.org/api/",\n"cache": "~/.ox/client.sqlite",\n"media-cache": "~/.ox/media",\n"volumes":{},\n"password":"'+password+'"\n }') myfile.close() |