[Top][All Lists]

[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


                 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



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 "../", line 192, in <module>
  File "../", line 82, in LoadBetzFamilyInfo
  File "/usr/lib/python2.7/dist-packages/proteus/", line 649, in
    self.__id = self._proxy.create(values, context)
  File "/usr/lib/python2.7/dist-packages/proteus/", line 144, in
    result = rpc.result(meth(*args, **kwargs))
  File "/usr/lib/python2.7/dist-packages/trytond/modules/health/",
line 578, in create
    return super(PartyPatient, cls).create(values)
  File "/usr/lib/python2.7/dist-packages/trytond/modules/party/", line
165, in create
    return super(Party, cls).create(values)
  File "/usr/lib/python2.7/dist-packages/trytond/model/", line 371,
in create
  File "/usr/lib/python2.7/dist-packages/trytond/", line 70, in
    raise UserError(error)
trytond.exceptions.UserError: ('UserError', ('This health professional is
already assigned to a party', ''))


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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