piwigo: Let getStatus return the current user.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Fri, 29 Mar 2013 13:48:08 +0000 (14:48 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Wed, 8 May 2013 22:21:03 +0000 (00:21 +0200)
If there is a user logged in, show his name.

mediagoblin/plugins/piwigo/views.py

index 6a246f18b11383e890d78345325cb57e8e041913..5d7d371d87dc70485102f9a5f7ab9591869ef18e 100644 (file)
@@ -61,7 +61,11 @@ def pwg_getversion(request):
 
 @CmdTable("pwg.session.getStatus")
 def pwg_session_getStatus(request):
-    return {'username': "fake_user"}
+    if request.user:
+        username = request.user.username
+    else:
+        username = "guest"
+    return {'username': username}
 
 
 @CmdTable("pwg.categories.getList")