[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-bugs] <bug>: adding a province > used an already set cod
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-bugs] <bug>: adding a province > used an already set cod |
Date: |
Sun, 27 Jan 2013 20:47:41 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hello Francois,
thanks for your report !
> user comment : adding a province > used an already set code (NR)
>
> client version: 1.2.6
...
> 2013-01-27 17:06:17 DEBUG gm.gui
> (/usr/share/gnumed/Gnumed/wxpython/gmExceptionHandlingWidgets.py::handle_uncaught_exception_wx()
> #186): unhandled exception caught:
> Traceback (most recent call last):
> File "/usr/share/gnumed/Gnumed/wxpython/gmEditArea.py", line 312, in
> _on_save_button_pressed
> if self._PNL_ea.save():
> File "/usr/share/gnumed/Gnumed/wxpython/gmEditArea.py", line 191, in save
> if self._save_as_new():
> File "/usr/share/gnumed/Gnumed/wxpython/gmAddressWidgets.py", line 420, in
> _save_as_new
> country = self._PRW_country.GetData()
> File "/usr/share/gnumed/Gnumed/business/gmDemographicRecord.py", line 296,
> in create_province
> gmPG2.run_rw_queries(queries = [{'cmd': cmd, 'args': args}])
> File "/usr/share/gnumed/Gnumed/pycommon/gmPG2.py", line 1264, in
> run_rw_queries
> curs.execute(query['cmd'], args)
> File "/usr/lib/python2.7/dist-packages/psycopg2/extras.py", line 123, in
> execute
> return _cursor.execute(self, query, vars)
> IntegrityError: duplicate key value violates unique constraint
> "idx_dem_state_code_country"
> DETAIL: Key (lower(code), country)=(nr, FR) already exists.
Let's see:
> 2013-01-27 17:06:17 DEBUG gm.logging
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #155): >>>
> execution frame [edit_province] in
> [/usr/share/gnumed/Gnumed/wxpython/gmAddressWidgets.py] at line 176 <<<
Ah, you were editing provinces.
> 2013-01-27 17:06:17 DEBUG gm.logging
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #155): >>>
> execution frame [_save_as_new] in
> [/usr/share/gnumed/Gnumed/wxpython/gmAddressWidgets.py] at line 420 <<<
You were adding a new province.
> 2013-01-27 17:06:17 DEBUG gm.logging
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #155): >>>
> execution frame [create_province] in
> [/usr/share/gnumed/Gnumed/business/gmDemographicRecord.py] at line 296 <<<
> 2013-01-27 17:06:17 DEBUG gm.logging
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #170):
> args = {'country': u'FR', 'code': u'NR', 'name': u'Normandie'}
> 2013-01-27 17:06:17 DEBUG gm.logging
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #170):
> name = Normandie
> 2013-01-27 17:06:17 DEBUG gm.logging
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #170):
> country = FR
You were trying to add Normandie, France.
This fails because the region code NR can only be used once:
> DETAIL: Key (lower(code), country)=(nr, FR) already exists.
Now, the question is - why would you want to add
"Normandie"? Looking at the default GNUmed install there
already IS a "Normandy, NR, FR". But then, that's English
and you likely prefer to use the proper French "Normandie".
To that end you will want to add a French translation (I
know this way of putting it is not politically correct en
franc,ais :-) Translation works like this:
Menu "GNUmed"
-> Master Data
-> Manage Lists
-> string translations
-> choose language
-> scroll down to "Normandy"
-> edit
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346