lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.11-36-gac50afa

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.11-36-gac50afa



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  ac50afa042c50ca9c50a9c9e8256ebbf018fc670 (commit)
       via  aadf121db70868370bfcfc7f9f9674e7adf0fb69 (commit)
      from  8cb71f2cd791fb87908c55009fd964d542acde44 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=ac50afa042c50ca9c50a9c9e8256ebbf018fc670

commit ac50afa042c50ca9c50a9c9e8256ebbf018fc670
Author: Jeffry Jesus De La Rosa <jeffryjesus@gmail.com>
Date:   Fri Oct 11 15:32:08 2019 -0400

    Change DGII form parameters
    
    DGII has changed their validation mechanism, so we first exract the
    __EVENTVALIDATION and __VIEWSTATE from the form and put them in the post
    request for validation.
    
    Closes https://github.com/arthurdejong/python-stdnum/pull/165

diff --git a/stdnum/do/ncf.py b/stdnum/do/ncf.py
index aa4c924..2c1ae9b 100644
--- a/stdnum/do/ncf.py
+++ b/stdnum/do/ncf.py
@@ -173,10 +173,14 @@ def check_dgii(rnc, ncf, timeout=30):  # pragma: no cover
     headers = {
         'User-Agent': 'Mozilla/5.0 (python-stdnum)',
     }
+    result = BeautifulSoup(
+        requests.get(url, headers=headers, timeout=timeout).text)
+    validation = result.find('input', {'name': '__EVENTVALIDATION'})['value']
+    viewstate = result.find('input', {'name': '__VIEWSTATE'})['value']
     data = {
-        '__EVENTVALIDATION': 
'/wEWBAKh8pDuCgK+9LSUBQLfnOXIDAKErv7SBhjZB34//pbvvJzrbkFCGGPRElcd',
-        '__VIEWSTATE': '/wEPDwUJNTM1NDc0MDQ5ZGRCFUYoDcVRgzEntcKfSuvPnC2VhA==',
-        'ctl00$cphMain$btnConsultar': 'Consultar',
+        '__EVENTVALIDATION': validation,
+        '__VIEWSTATE': viewstate,
+        'ctl00$cphMain$btnConsultar': 'Buscar',
         'ctl00$cphMain$txtNCF': ncf,
         'ctl00$cphMain$txtRNC': rnc,
     }

https://arthurdejong.org/git/python-stdnum/commit/?id=aadf121db70868370bfcfc7f9f9674e7adf0fb69

commit aadf121db70868370bfcfc7f9f9674e7adf0fb69
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Oct 13 14:52:06 2019 +0200

    Avoid skipping missing interpreters on Travis

diff --git a/.travis.yml b/.travis.yml
index a288c84..935844b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,4 +18,4 @@ matrix:
   - python: 3.6
     env: TOXENV=docs
 install: pip install tox
-script: tox -e "${TOXENV:-$(echo py$TRAVIS_PYTHON_VERSION | tr -d . | sed -e 
's/pypypy/pypy/')}"
+script: tox -e "${TOXENV:-$(echo py$TRAVIS_PYTHON_VERSION | tr -d . | sed -e 
's/pypypy/pypy/')}" --skip-missing-interpreters false

-----------------------------------------------------------------------

Summary of changes:
 .travis.yml      |  2 +-
 stdnum/do/ncf.py | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
python-stdnum