# 308 To share info message
* adds needs-to-be-shared info message on entries which are only shared with the current user
This commit is contained in:
@@ -26,7 +26,7 @@ from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
|
||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
||||
from konova.utils.message_templates import COMPENSATION_REMOVED_TEMPLATE, DATA_CHECKED_PREVIOUSLY_TEMPLATE, \
|
||||
RECORDED_BLOCKS_EDIT, CHECKED_RECORDED_RESET, FORM_INVALID, PARAMS_INVALID, IDENTIFIER_REPLACED, \
|
||||
COMPENSATION_ADDED_TEMPLATE
|
||||
COMPENSATION_ADDED_TEMPLATE, DO_NOT_FORGET_TO_SHARE
|
||||
from konova.utils.user_checks import in_group
|
||||
|
||||
|
||||
@@ -236,6 +236,13 @@ def detail_view(request: HttpRequest, id: str):
|
||||
if last_checked:
|
||||
last_checked_tooltip = DATA_CHECKED_PREVIOUSLY_TEMPLATE.format(last_checked.get_timestamp_str_formatted(), last_checked.user)
|
||||
|
||||
requesting_user_is_only_shared_user = comp.is_only_shared_with(_user)
|
||||
if requesting_user_is_only_shared_user:
|
||||
messages.info(
|
||||
request,
|
||||
DO_NOT_FORGET_TO_SHARE
|
||||
)
|
||||
|
||||
context = {
|
||||
"obj": comp,
|
||||
"last_checked": last_checked,
|
||||
|
||||
@@ -22,7 +22,7 @@ from konova.forms import SimpleGeomForm
|
||||
from konova.settings import ETS_GROUP, DEFAULT_GROUP, ZB_GROUP
|
||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
||||
from konova.utils.message_templates import CANCEL_ACC_RECORDED_OR_DEDUCTED, RECORDED_BLOCKS_EDIT, FORM_INVALID, \
|
||||
IDENTIFIER_REPLACED
|
||||
IDENTIFIER_REPLACED, DO_NOT_FORGET_TO_SHARE
|
||||
from konova.utils.user_checks import in_group
|
||||
|
||||
|
||||
@@ -213,6 +213,13 @@ def detail_view(request: HttpRequest, id: str):
|
||||
|
||||
request = acc.set_status_messages(request)
|
||||
|
||||
requesting_user_is_only_shared_user = acc.is_only_shared_with(_user)
|
||||
if requesting_user_is_only_shared_user:
|
||||
messages.info(
|
||||
request,
|
||||
DO_NOT_FORGET_TO_SHARE
|
||||
)
|
||||
|
||||
context = {
|
||||
"obj": acc,
|
||||
"geom_form": geom_form,
|
||||
|
||||
Reference in New Issue
Block a user