#1518 closed defect (fixed)
Subtle problem - with @cached_classproperty affecting Group.addMember()
Reported by: | hoffmann | Owned by: | amonnich |
---|---|---|---|
Priority: | critical | Milestone: | v1.2 |
Component: | General | Version: | 1.2 |
Keywords: | Cc: |
Description
As described here, the addMember() function cannot be used in a script without raising an AttributeError.
I am not good enough yet to understand the decorators in every context, but it seems to me that the @cached_classproperty interferes with some (new?) features of MaKaC.common.timerExec.Alarm. The decorator obviously is supposed to hide non-existing attributes as long as the relevant class has not yet been declared in python. It is used in the declaration of the Avatar class, source:/indico/MaKaC/user.py@476d3fc1105d2c452644f1879b083805dc7bc091#L314 apparently.
I found a workaround: Add
from MaKaC.common.timerExec import Alarm #WORKAROUND (>v1.2.2)
to all my problematic scripts.
I hope some more competent programmer than me can quickly find out the right way to fix it.
Change History (3)
comment:1 Changed 18 months ago by hoffmann
comment:2 Changed 18 months ago by pferreir
- Owner set to amonnich
- Status changed from new to assigned
comment:3 Changed 18 months ago by jmonnich
- Resolution set to fixed
- Status changed from assigned to closed
Fixed in e20e3ae. Within Indico it worked because those modules have been imported somewhere before accessing the property.
(Sorry, I did not manage to link the source file correctly into the ticket.)