diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-02 15:33:56 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-02 15:33:56 +0100 |
| commit | 009659e8caff8281aac22efe1756957aa4b3e9b2 (patch) | |
| tree | 6e8ffab7918d9a8519d2c45bb95dea18cdd9bf99 /archaeological_finds/models_finds.py | |
| parent | f57d96f2a0f7a58728768d6160a5b04b869dab25 (diff) | |
| download | Ishtar-009659e8caff8281aac22efe1756957aa4b3e9b2.tar.bz2 Ishtar-009659e8caff8281aac22efe1756957aa4b3e9b2.zip | |
Manage multiple condition for cascading shortcut menu - Manage shortcut menu for treatment and treatment files (refs #3384)
Diffstat (limited to 'archaeological_finds/models_finds.py')
| -rw-r--r-- | archaeological_finds/models_finds.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 9a7a71f84..e29669773 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -663,9 +663,11 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): @classmethod def get_owns(cls, user, menu_filtr=None, limit=None): - replace_query = {} - if menu_filtr: - replace_query = {'base_finds__context_record': menu_filtr} + replace_query = None + if menu_filtr and 'contextrecord' in menu_filtr: + replace_query = Q( + base_finds__context_record=menu_filtr['contextrecord'] + ) owns = super(Find, cls).get_owns( user, replace_query=replace_query, limit=limit) |
