google-code-export / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
1 stars 0 forks source link

Can't disable the notifications of ACL changes #566

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As the documentation state, to disable notifications, you need to set 
send-notification-emails=false
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#AC
LEmails

But in the code of DocsClient this the portion of code that is supposed to do 
this :
    if send_notifications is not None:
      if send_notifications:
        uri += '?send-notification-emails=true'

As the documentation state, true is the default value of the 
send-notification-emails. So this code does not allow us to change anything.
instead, it should be :
if send_notifications is False:
  uri += '?send-notification-emails=false'

Also if the library is used in an oauth 2 leg environment, the uri is going to 
look like this :
https://docs.google.com/feeds/default/private/full/folder%3A0By8n6mzbHn8DOTk2N2Y
xYzctZWE0Yi00ZTJlLTlkMzItMTg5MTEyNTgxMzI2/acl?xoauth_requestor_id=jeremi@demo1.w
emakeprojects.com

So if we concatenate ?send-notification-emails=false, the url is not going be 
valid anymore. So instead, we need something like this :

    if send_notifications is False:
      if "?" in uri:
        uri += '&send-notification-emails=false'
      else:
        uri += '?send-notification-emails=false'

Original issue reported on code.google.com by jer...@wemakeprojects.com on 18 Nov 2011 at 5:41

GoogleCodeExporter commented 9 years ago
Batching ACL is probably not working as well for 2 reasons :
* the url construction does not work when we use oAuth 2 legs
* it's adding '/acl' at the end of the url instead of '/batch'

Original comment by jer...@wemakeprojects.com on 18 Nov 2011 at 6:12

GoogleCodeExporter commented 9 years ago
Oops, you're right!  I just fixed this in revision 6cade1a02b0b, and it will go 
out in the next release.

Thanks!

Original comment by vicfry...@google.com on 22 Nov 2011 at 11:40

GoogleCodeExporter commented 9 years ago
Just looked at your revision Vic and you neglected to change the second part of 
what jeremi proposed.

It looks like you corrected the logic of the if statement, but the even more 
important part is how the url is built.  The problem occurs when & should be 
used instead of the ? if there is already a ? in the url.  Practically this 
happens to me when the ?xoauth_requestor_id=username@example.com is already on 
the end of the GetEditLink href.

If you neglected to make this change on purpose, why?

Thanks for all you do!

Original comment by gmcge...@mc.edu on 29 Mar 2012 at 2:21