health-dev
[Top][All Lists]
Advanced

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

[Health-dev] [bug #39053] Demo script is not idempotent


From: Emilien Klein
Subject: [Health-dev] [bug #39053] Demo script is not idempotent
Date: Thu, 23 May 2013 18:53:36 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20100101 Firefox/10.0.12 Iceweasel/10.0.12

URL:
  <http://savannah.gnu.org/bugs/?39053>

                 Summary: Demo script is not idempotent
                 Project: GNU Health
            Submitted by: e2jk
            Submitted on: Thu 23 May 2013 06:53:36 PM GMT
                Category: Demo environment
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
                  Module: demo

    _______________________________________________________

Details:

If the demo script is run multiple times, it will:
- create multiple "GNU SOLIDARIO Hospital" parties
- create multiple "Insurator" parties
- end up crashing (Traceback copied below)

In the process of creating the Debian package for GNU Health, I plan to create
a gnuhealth-demo package which will create the demo database for the user. The
creation script will be run each time the package is updated.

My suggestion is to add a check as the first thing in the script, to see if
the gnuhealth-demo database already exists. If that's the case, then don't go
further and stop the script.



Traceback (most recent call last):
  File "../health_demo_server.py", line 192, in <module>
    LoadBetzFamilyInfo()
  File "../health_demo_server.py", line 82, in LoadBetzFamilyInfo
    party.save()
  File "/usr/lib/python2.7/dist-packages/proteus/__init__.py", line 649, in
save
    self.__id = self._proxy.create(values, context)
  File "/usr/lib/python2.7/dist-packages/proteus/config.py", line 144, in
__call__
    result = rpc.result(meth(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/trytond/modules/health/health.py",
line 578, in create
    return super(PartyPatient, cls).create(values)
  File "/usr/lib/python2.7/dist-packages/trytond/modules/party/party.py", line
165, in create
    return super(Party, cls).create(values)
  File "/usr/lib/python2.7/dist-packages/trytond/model/modelsql.py", line 371,
in create
    cls.raise_user_error(error)
  File "/usr/lib/python2.7/dist-packages/trytond/error.py", line 70, in
raise_user_error
    raise UserError(error)
trytond.exceptions.UserError: ('UserError', ('This health professional is
already assigned to a party', ''))





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39053>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]