diff options
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r-- | archaeological_context_records/models.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 3cb0313dd..e3c7ff4e5 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -35,7 +35,7 @@ from ishtar_common.models import Document, GeneralType, \ BaseHistorizedItem, HistoricalRecords, OwnPerms, ShortMenuItem, \ GeneralRelationType, GeneralRecordRelations, post_delete_record_relation,\ post_save_cache, ValueGetter, BulkUpdatedItem, \ - RelationItem, Town + RelationItem, Town, get_current_profile from archaeological_operations.models import Operation, Period, Parcel, \ ArchaeologicalSite @@ -436,6 +436,8 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, return kwargs['transaction_id'] = transaction_id + profile = get_current_profile() + sql = """ UPDATE "archaeological_context_records_contextrecord" AS cr SET cached_label = @@ -469,8 +471,8 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, SELECT id FROM archaeological_context_records_contextrecord WHERE {where} ); - """.format(main_ope_prefix=settings.ISHTAR_OPE_PREFIX, - ope_prefix=settings.ISHTAR_DEF_OPE_PREFIX, + """.format(main_ope_prefix=profile.operation_prefix, + ope_prefix=profile.default_operation_prefix, join=settings.JOINT, where=where) with connection.cursor() as c: c.execute(sql, args) |