Hello.
I want to change the card component automatically using the post request in
the python.
I tried everything I could and knew.
But trac gives me just only that (in any version of my code):
This ticket has been modified since you started editing. You should review
> the other modifications which have been appended above, and any conflicts
> shown in the preview below. You can nevertheless proceed and submit your
> changes if you wish so.
I know for sure: no one changed it.
I'm at a loss. Can you help me?
# _*_ coding:utf-8 _*_
#!/usr/bin/python
import requests
from requests.auth import HTTPDigestAuth
from requests.auth import HTTPBasicAuth
import time
def payload2(hed):
payload={\
"__FORM_TOKEN" : hed,\
"__EDITOR__1" : "textarea",\
"comment" : "test",\
"field_summary" : "test",\
"__EDITOR__2" : "textarea",\
"field_description" : "",\
"field_type" : u"info",\
"field_priority" : "major",\
"field_milestone" : "",\
"field_component" : u"Info",\
"field_keywords" : "",\
"field_cc" : "",\
"action" : "leave",\
"start_time" : str(current_time),\
"view_time" : str(current_time),\
"replyto" : "",\
"submit" : "Submit+changes"\
}
return payload
current_time = int(time.time()*1000000)
URL = "http://trac.bla-bla.com/ticket/91279"
with requests.Session() as s:
s = requests.Session()
s.auth= ('user', 'password')
login = s.get(URL)
s.cookies = login.cookies
hed = login.cookies["trac_form_token"]
hed = str(hed)
pay = payload2(hed)
ttt = requests.utils.dict_from_cookiejar(login.cookies)
print_text = s.post(URL, data=pay, cookies=ttt)
print unicode(print_text.text).encode('utf8')
print print_text.cookies
print requests.utils.dict_from_cookiejar(login.cookies)
But ticket does not change.
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.