summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-16 12:38:41 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-16 12:38:41 +0200
commitfe78f0db71ac7a9528925492c8521496dc6c36ed (patch)
treefa0614969e604e65396fabf9a48cbd7c97a410e8 /archaeological_context_records/models.py
parent5d0750488690ec698857aa40e4e16761d3aae613 (diff)
downloadIshtar-fe78f0db71ac7a9528925492c8521496dc6c36ed.tar.bz2
Ishtar-fe78f0db71ac7a9528925492c8521496dc6c36ed.zip
Manage ope prefixes with the profile
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py8
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)