Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 53d0af89ac | |||
| 7b5c1f0d97 | |||
| ef076c0b3b | |||
| 72a5075f3b | |||
| d677ac6b5a | |||
| 9149e4cbd3 | |||
| 1c24cbea26 | |||
| fa89bbba99 | |||
| 78eb711057 | |||
| 416ad8478c | |||
| 6b28c4ec15 | |||
| 46a2a4ff46 | |||
| 90e5cf5b36 | |||
| 50f46e319c | |||
| e2ea087c4e | |||
| a6e43b044b | |||
| be0d261e81 | |||
| 62e1b046c3 | |||
| 669a12410f | |||
| dd77e6c16e | |||
| 33774ce557 | |||
| dc3dc99b3d | |||
| 315f9de958 | |||
| 0726c15086 | |||
| 2492a8abe8 | |||
| dbc5cba5d7 | |||
| c8948ddaea | |||
| 5039da28aa | |||
| 4567339570 |
@@ -24,6 +24,7 @@ DEFAULT_FROM_EMAIL=service@ksp.de
|
||||
|
||||
# Proxy
|
||||
PROXY=CHANGE_ME
|
||||
MAP_PROXY_HOST_WHITELIST=CHANGE_ME_1,CHANGE_ME_2
|
||||
GEOPORTAL_RLP_USER=CHANGE_ME
|
||||
GEOPORTAL_RLP_PASSWORD=CHANGE_ME
|
||||
|
||||
@@ -37,6 +38,7 @@ SSO_SERVER_BASE_URL=https://login.naturschutz.rlp.de
|
||||
OAUTH_CODE_VERIFIER=CHANGE_ME
|
||||
OAUTH_CLIENT_ID=CHANGE_ME
|
||||
OAUTH_CLIENT_SECRET=CHANGE_ME
|
||||
PROPAGATION_SECRET=CHANGE_ME
|
||||
|
||||
# RabbitMQ
|
||||
## For connections to EGON
|
||||
|
||||
@@ -155,3 +155,25 @@ class OAuthToken(UuidModel):
|
||||
|
||||
return user
|
||||
|
||||
def revoke(self) -> int:
|
||||
""" Revokes the OAuth2 token of the user
|
||||
|
||||
(/o/revoke_token/ indeed removes the corresponding access token on provider side and invalidates the
|
||||
submitted refresh token in one step)
|
||||
|
||||
Returns:
|
||||
revocation_status_code (int): HTTP status code for revocation of refresh_token
|
||||
"""
|
||||
revoke_url = f"{SSO_SERVER_BASE}o/revoke_token/"
|
||||
token = self.refresh_token
|
||||
revocation_status_code = requests.post(
|
||||
revoke_url,
|
||||
data={
|
||||
'token': token,
|
||||
'token_type_hint': "refresh_token",
|
||||
},
|
||||
auth=(OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET),
|
||||
).status_code
|
||||
|
||||
return revocation_status_code
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Generated by Django 5.0.7 on 2024-08-06 13:40
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db import migrations
|
||||
from django.db.models import Q
|
||||
|
||||
@@ -10,9 +11,12 @@ def migrate_975_to_288(apps, schema_editor):
|
||||
KonovaCodeList = apps.get_model('codelist', 'KonovaCodeList')
|
||||
CompensationState = apps.get_model('compensation', 'CompensationState')
|
||||
|
||||
list_288 = KonovaCodeList.objects.get(
|
||||
id=CODELIST_BIOTOPES_EXTRA_CODES_FULL_ID
|
||||
).codes.all()
|
||||
try:
|
||||
list_288 = KonovaCodeList.objects.get(
|
||||
id=CODELIST_BIOTOPES_EXTRA_CODES_FULL_ID
|
||||
).codes.all()
|
||||
except ObjectDoesNotExist:
|
||||
raise AssertionError("KonovaCodeList 288 does not exist. Did you run 'update_codelist' before migrating?")
|
||||
|
||||
states_with_extra_code = CompensationState.objects.filter(
|
||||
~Q(biotope_type_details=None)
|
||||
@@ -42,8 +46,15 @@ class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('codelist', '0001_initial'),
|
||||
('compensation', '0003_auto_20220202_0846'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(migrate_975_to_288)
|
||||
]
|
||||
# If migration of codelist is not necessary, this variable can shut down the logic whilst not disturbing the
|
||||
# migration history
|
||||
EXECUTE_CODELIST_MIGRATION = True
|
||||
|
||||
operations = []
|
||||
|
||||
if EXECUTE_CODELIST_MIGRATION:
|
||||
operations.append(migrations.RunPython(migrate_975_to_288))
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 5.0.8 on 2024-08-26 16:47
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('codelist', '0002_migrate_975_to_288'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='konovacode',
|
||||
name='long_name',
|
||||
field=models.CharField(blank=True, default="", max_length=1000),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='konovacode',
|
||||
name='short_name',
|
||||
field=models.CharField(blank=True, default="", help_text='Short version of long name', max_length=500),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 5.0.8 on 2024-08-26 16:47
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('codelist', '0003_alter_konovacode_long_name_and_more'),
|
||||
('compensation', '0015_alter_compensation_after_states_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='compensationstate',
|
||||
name='biotope_type_details',
|
||||
field=models.ManyToManyField(blank=True, limit_choices_to={'code_lists__in': [288], 'is_archived': False, 'is_selectable': True}, related_name='+', to='codelist.konovacode'),
|
||||
),
|
||||
]
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-action' obj.id %}" title="{% trans 'Add new action' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'seedling' %}
|
||||
@@ -34,7 +34,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Comment' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{% fa5_icon 'file-alt' %}
|
||||
</button>
|
||||
</a>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'compensation:resubmission-create' obj.id %}">
|
||||
{% fa5_icon 'bell' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-deadline' obj.id %}" title="{% trans 'Add new deadline' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'calendar-check' %}
|
||||
@@ -38,7 +38,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Comment' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'file' %}
|
||||
@@ -33,7 +33,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Comment' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-state' obj.id %}" title="{% trans 'Add new state after' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'layer-group' %}
|
||||
@@ -35,7 +35,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Surface' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -58,7 +58,7 @@
|
||||
</td>
|
||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-state' obj.id %}?before=true" title="{% trans 'Add new state before' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'layer-group' %}
|
||||
@@ -35,7 +35,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Surface' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -58,7 +58,7 @@
|
||||
</td>
|
||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
{% include 'user/includes/team_data_modal_button.html' %}
|
||||
{% endfor %}
|
||||
<hr>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
{% for user in obj.intervention.shared_users %}
|
||||
{% include 'user/includes/contact_modal_button.html' %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-action' obj.id %}" title="{% trans 'Add new action' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'seedling' %}
|
||||
@@ -33,7 +33,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Comment' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:acc:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{% fa5_icon 'file-alt' %}
|
||||
</button>
|
||||
</a>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'compensation:acc:resubmission-create' obj.id %}">
|
||||
{% fa5_icon 'bell' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-deadline' obj.id %}" title="{% trans 'Add new deadline' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'calendar-check' %}
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:acc:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<td class="align-middle">{{ deduction.surface|floatformat:2|intcomma }} m²</td>
|
||||
<td class="align-middle">{{ deduction.created.timestamp|default_if_none:""|naturalday}}</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access or is_default_member and user in deduction.intervention.shared_users %}
|
||||
{% if is_default_member and is_entry_shared or is_default_member and user in deduction.intervention.shared_users %}
|
||||
<button data-form-url="{% url 'compensation:acc:edit-deduction' deduction.account.id deduction.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit Deduction' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'file' %}
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:acc:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-state' obj.id %}" title="{% trans 'Add new state after' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'layer-group' %}
|
||||
@@ -35,7 +35,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Surface' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -58,7 +58,7 @@
|
||||
</td>
|
||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:acc:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-state' obj.id %}?before=true" title="{% trans 'Add new state before' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'layer-group' %}
|
||||
@@ -35,7 +35,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Surface' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -58,7 +58,7 @@
|
||||
</td>
|
||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:acc:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
{% include 'user/includes/team_data_modal_button.html' %}
|
||||
{% endfor %}
|
||||
<hr>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
{% for user in obj.users.all %}
|
||||
{% include 'user/includes/contact_modal_button.html' %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -259,7 +259,7 @@ def detail_view(request: HttpRequest, id: str):
|
||||
"last_checked_tooltip": last_checked_tooltip,
|
||||
"geom_form": geom_form,
|
||||
"parcels": parcels,
|
||||
"has_access": is_data_shared,
|
||||
"is_entry_shared": is_data_shared,
|
||||
"actions": actions,
|
||||
"before_states": before_states,
|
||||
"after_states": after_states,
|
||||
|
||||
@@ -67,7 +67,7 @@ def report_view(request: HttpRequest, id: str):
|
||||
"img": qrcode_img_lanis,
|
||||
"url": qrcode_lanis_url,
|
||||
},
|
||||
"has_access": False, # disables action buttons during rendering
|
||||
"is_entry_shared": False, # disables action buttons during rendering
|
||||
"before_states": before_states,
|
||||
"after_states": after_states,
|
||||
"geom_form": geom_form,
|
||||
|
||||
@@ -237,7 +237,7 @@ def detail_view(request: HttpRequest, id: str):
|
||||
"obj": acc,
|
||||
"geom_form": geom_form,
|
||||
"parcels": parcels,
|
||||
"has_access": is_data_shared,
|
||||
"is_entry_shared": is_data_shared,
|
||||
"before_states": before_states,
|
||||
"after_states": after_states,
|
||||
"sum_before_states": sum_before_states,
|
||||
|
||||
@@ -73,7 +73,7 @@ def report_view(request: HttpRequest, id: str):
|
||||
"img": qrcode_img_lanis,
|
||||
"url": qrcode_lanis_url,
|
||||
},
|
||||
"has_access": False, # disables action buttons during rendering
|
||||
"is_entry_shared": False, # disables action buttons during rendering
|
||||
"before_states": before_states,
|
||||
"after_states": after_states,
|
||||
"geom_form": geom_form,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-action' obj.id %}" title="{% trans 'Add new action' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'seedling' %}
|
||||
@@ -61,7 +61,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'ema:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{% fa5_icon 'file-alt' %}
|
||||
</button>
|
||||
</a>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'ema:resubmission-create' obj.id %}">
|
||||
{% fa5_icon 'bell' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-deadline' obj.id %}" title="{% trans 'Add new deadline' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'calendar-check' %}
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'ema:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'file' %}
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'ema:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-state' obj.id %}" title="{% trans 'Add new state after' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'layer-group' %}
|
||||
@@ -56,7 +56,7 @@
|
||||
</td>
|
||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'ema:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-state' obj.id %}?before=true" title="{% trans 'Add new state before' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'layer-group' %}
|
||||
@@ -56,7 +56,7 @@
|
||||
</td>
|
||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'ema:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
{% include 'user/includes/team_data_modal_button.html' %}
|
||||
{% endfor %}
|
||||
<hr>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
{% for user in obj.users.all %}
|
||||
{% include 'user/includes/contact_modal_button.html' %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -142,7 +142,7 @@ def detail_view(request: HttpRequest, id: str):
|
||||
geom_form = SimpleGeomForm(instance=ema)
|
||||
parcels = ema.get_underlying_parcels()
|
||||
_user = request.user
|
||||
is_data_shared = ema.is_shared_with(_user)
|
||||
is_entry_shared = ema.is_shared_with(_user)
|
||||
|
||||
# Order states according to surface
|
||||
before_states = ema.before_states.all().order_by("-surface")
|
||||
@@ -167,7 +167,7 @@ def detail_view(request: HttpRequest, id: str):
|
||||
"obj": ema,
|
||||
"geom_form": geom_form,
|
||||
"parcels": parcels,
|
||||
"has_access": is_data_shared,
|
||||
"is_entry_shared": is_entry_shared,
|
||||
"before_states": before_states,
|
||||
"after_states": after_states,
|
||||
"sum_before_states": sum_before_states,
|
||||
|
||||
@@ -67,7 +67,7 @@ def report_view(request:HttpRequest, id: str):
|
||||
"img": qrcode_img_lanis,
|
||||
"url": qrcode_lanis_url
|
||||
},
|
||||
"has_access": False, # disables action buttons during rendering
|
||||
"is_entry_shared": False, # disables action buttons during rendering
|
||||
"before_states": before_states,
|
||||
"after_states": after_states,
|
||||
"geom_form": geom_form,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<a href="{% url 'compensation:new' obj.id %}" title="{% trans 'Add new compensation' %}">
|
||||
<button class="btn btn-outline-default">
|
||||
{% fa5_icon 'plus' %}
|
||||
@@ -32,7 +32,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Title' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -51,7 +51,7 @@
|
||||
</td>
|
||||
<td class="align-middle">{{ comp.title }}</td>
|
||||
<td>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'intervention:remove-compensation' obj.id comp.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove compensation' %}">
|
||||
{% fa5_icon 'trash' %}
|
||||
</button>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{% fa5_icon 'file-alt' %}
|
||||
</button>
|
||||
</a>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
<button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'intervention:resubmission-create' obj.id %}">
|
||||
{% fa5_icon 'bell' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-deduction' obj.id %}" title="{% trans 'Add new deduction' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'tree' %}
|
||||
@@ -33,7 +33,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Created' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -56,7 +56,7 @@
|
||||
<td class="align-middle">{{ deduction.surface|floatformat:2|intcomma }} m²</td>
|
||||
<td class="align-middle">{{ deduction.created.timestamp|default_if_none:""|naturalday}}</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'intervention:edit-deduction' obj.id deduction.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit Deduction' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'file' %}
|
||||
@@ -38,7 +38,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Comment' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -66,7 +66,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'intervention:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:pay:new' obj.id %}" title="{% trans 'Add new payment' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'money-bill-wave' %}
|
||||
@@ -33,7 +33,7 @@
|
||||
<th class="w-50" scope="col">
|
||||
{% trans 'Comment' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -46,16 +46,24 @@
|
||||
{% for pay in obj.payments.all %}
|
||||
<tr>
|
||||
<td class="align-middle">
|
||||
{{ pay.amount|floatformat:2 }} €
|
||||
{% if is_entry_shared %}
|
||||
{{ pay.amount|floatformat:2 }} €
|
||||
{% else %}
|
||||
***
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="align-middle">{{ pay.due_on|default_if_none:"---" }}</td>
|
||||
<td class="align-middle">
|
||||
<div class="scroll-150">
|
||||
{{ pay.comment }}
|
||||
{% if is_entry_shared %}
|
||||
{{ pay.comment }}
|
||||
{% else %}
|
||||
{% trans 'This data is not shared with you' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'compensation:pay:edit' obj.id pay.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit payment' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{% comment %}
|
||||
Only show add-button if no revocation exists, yet.
|
||||
{% endcomment %}
|
||||
{% if is_default_member and has_access and not obj.legal.revocation %}
|
||||
{% if is_default_member and is_entry_shared and not obj.legal.revocation %}
|
||||
<button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-revocation' obj.id %}" title="{% trans 'Add revocation' %}">
|
||||
{% fa5_icon 'plus' %}
|
||||
{% fa5_icon 'ban' %}
|
||||
@@ -36,7 +36,7 @@
|
||||
<th scope="col">
|
||||
{% trans 'Comment' %}
|
||||
</th>
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<th class="w-10" scope="col">
|
||||
<span class="float-right">
|
||||
{% trans 'Action' %}
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle float-right">
|
||||
{% if is_default_member and has_access %}
|
||||
{% if is_default_member and is_entry_shared %}
|
||||
<button data-form-url="{% url 'intervention:edit-revocation' obj.id rev.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit revocation' %}">
|
||||
{% fa5_icon 'edit' %}
|
||||
</button>
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
{% include 'user/includes/team_data_modal_button.html' %}
|
||||
{% endfor %}
|
||||
<hr>
|
||||
{% if has_access %}
|
||||
{% if is_entry_shared %}
|
||||
{% for user in obj.users.all %}
|
||||
{% include 'user/includes/contact_modal_button.html' %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -185,7 +185,7 @@ def detail_view(request: HttpRequest, id: str):
|
||||
"last_checked": last_checked,
|
||||
"last_checked_tooltip": last_checked_tooltip,
|
||||
"compensations": compensations,
|
||||
"has_access": is_data_shared,
|
||||
"is_entry_shared": is_data_shared,
|
||||
"geom_form": geom_form,
|
||||
"is_default_member": _user.in_group(DEFAULT_GROUP),
|
||||
"is_zb_member": _user.in_group(ZB_GROUP),
|
||||
|
||||
55
konova/filters/mixins/user_log.py
Normal file
55
konova/filters/mixins/user_log.py
Normal file
@@ -0,0 +1,55 @@
|
||||
"""
|
||||
Author: Michel Peltriaux
|
||||
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
||||
Contact: ksp-servicestelle@sgdnord.rlp.de
|
||||
Created on: 19.08.24
|
||||
|
||||
"""
|
||||
import django_filters
|
||||
from django import forms
|
||||
from django.db.models import QuerySet, Q
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class UserLoggedTableFilterMixin(django_filters.FilterSet):
|
||||
ul = django_filters.CharFilter(
|
||||
method="filter_user_log",
|
||||
label=_(""),
|
||||
label_suffix=_(""),
|
||||
widget=forms.TextInput(
|
||||
attrs={
|
||||
"placeholder": _("Logged user"),
|
||||
"title": _("Search for entries where this person has been participated according to log history"),
|
||||
"class": "form-control",
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
def filter_user_log(self, queryset, name, value) -> QuerySet:
|
||||
""" Filters queryset depending on value of input
|
||||
|
||||
Args:
|
||||
queryset (QuerySet): Incoming (prefiltered) queryset
|
||||
name (str): Name of input field
|
||||
value (str): Value of input field
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
value = value.replace(",", " ")
|
||||
value = value.strip()
|
||||
values = value.split(" ")
|
||||
|
||||
q = Q()
|
||||
for val in values:
|
||||
q &= (
|
||||
Q(log__user__username__icontains=val) |
|
||||
Q(log__user__first_name__icontains=val) |
|
||||
Q(log__user__last_name__icontains=val)
|
||||
)
|
||||
|
||||
queryset = queryset.filter(q)
|
||||
return queryset
|
||||
@@ -14,6 +14,7 @@ from konova.filters.mixins.office import ConservationOfficeTableFilterMixin, Reg
|
||||
from konova.filters.mixins.record import RecordableTableFilterMixin
|
||||
from konova.filters.mixins.self_created import SelfCreatedTableFilterMixin
|
||||
from konova.filters.mixins.share import ShareableTableFilterMixin
|
||||
from konova.filters.mixins.user_log import UserLoggedTableFilterMixin
|
||||
|
||||
|
||||
class AbstractTableFilter(django_filters.FilterSet):
|
||||
@@ -40,7 +41,8 @@ class SelectionTableFilter(RegistrationOfficeTableFilterMixin,
|
||||
|
||||
class QueryTableFilter(KeywordTableFilterMixin,
|
||||
FileNumberTableFilterMixin,
|
||||
GeoReferencedTableFilterMixin):
|
||||
GeoReferencedTableFilterMixin,
|
||||
UserLoggedTableFilterMixin):
|
||||
""" TableFilter holding different filter options for query related filtering
|
||||
|
||||
"""
|
||||
|
||||
@@ -6,11 +6,11 @@ Created on: 26.10.22
|
||||
|
||||
"""
|
||||
import zipfile
|
||||
from datetime import datetime
|
||||
from io import BytesIO
|
||||
|
||||
from django.core.mail import EmailMessage
|
||||
from django.utils import timezone
|
||||
from django.utils.datetime_safe import datetime
|
||||
|
||||
from analysis.utils.excel.excel import TempExcelFile
|
||||
from analysis.utils.report import TimespanReport
|
||||
|
||||
86
konova/management/commands/recalculate_parcels.py
Normal file
86
konova/management/commands/recalculate_parcels.py
Normal file
@@ -0,0 +1,86 @@
|
||||
"""
|
||||
Author: Michel Peltriaux
|
||||
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
||||
Contact: michel.peltriaux@sgdnord.rlp.de
|
||||
Created on: 04.01.22
|
||||
|
||||
"""
|
||||
import datetime
|
||||
|
||||
from django.contrib.gis.db.models.functions import Area
|
||||
|
||||
from konova.management.commands.setup import BaseKonovaCommand
|
||||
from konova.models import Geometry, ParcelIntersection
|
||||
|
||||
|
||||
class Command(BaseKonovaCommand):
|
||||
help = "Recalculates parcels for entries with geometry but missing parcel information"
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
"--force-all",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="If Attribute set, all entries parcels will be recalculated"
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
try:
|
||||
self.recalculate_parcels(options)
|
||||
except KeyboardInterrupt:
|
||||
self._break_line()
|
||||
exit(-1)
|
||||
|
||||
def recalculate_parcels(self, options: dict):
|
||||
force_all = options.get("force_all", False)
|
||||
|
||||
geometry_objects = Geometry.objects.all().exclude(
|
||||
geom=None
|
||||
)
|
||||
|
||||
if not force_all:
|
||||
# Fetch all intersections
|
||||
intersection_objs = ParcelIntersection.objects.filter(
|
||||
geometry__in=geometry_objects
|
||||
)
|
||||
# Just take the geometry ids, which seem to have intersections
|
||||
geom_with_intersection_ids = intersection_objs.values_list(
|
||||
"geometry__id",
|
||||
flat=True
|
||||
)
|
||||
# ... and resolve into Geometry objects again ...
|
||||
intersected_geom_objs = Geometry.objects.filter(
|
||||
id__in=geom_with_intersection_ids
|
||||
)
|
||||
# ... to be able to use the way more efficient difference() function ...
|
||||
geometry_objects_ids = geometry_objects.difference(intersected_geom_objs).values_list("id", flat=True)
|
||||
# ... so we can resolve these into proper Geometry objects again for further annotation usage
|
||||
geometry_objects = Geometry.objects.filter(id__in=geometry_objects_ids)
|
||||
|
||||
self._write_warning("=== Update parcels and districts ===")
|
||||
# Order geometries by size to process smaller once at first
|
||||
geometries = geometry_objects.annotate(
|
||||
area=Area("geom")
|
||||
).order_by(
|
||||
'area'
|
||||
)
|
||||
self._write_warning(f"Process parcels for {geometries.count()} geometry entries now ...")
|
||||
i = 0
|
||||
num_geoms = geometries.count()
|
||||
geoms_with_errors = {}
|
||||
for geometry in geometries:
|
||||
self._write_warning(f"--- {datetime.datetime.now()} Process {geometry.id} now ...")
|
||||
try:
|
||||
geometry.update_parcels()
|
||||
self._write_warning(f"--- Processed {geometry.get_underlying_parcels().count()} underlying parcels")
|
||||
except Exception as e:
|
||||
geoms_with_errors[geometry.id] = str(e)
|
||||
i += 1
|
||||
self._write_warning(f"--- {i}/{num_geoms} processed")
|
||||
|
||||
self._write_success("Updating parcels done!")
|
||||
|
||||
for key, val in geoms_with_errors.items():
|
||||
self._write_error(f" Error on {key}: {val}")
|
||||
self._write_success(f"{num_geoms - len(geoms_with_errors)} geometries successfuly recalculated!")
|
||||
self._break_line()
|
||||
@@ -1,54 +0,0 @@
|
||||
"""
|
||||
Author: Michel Peltriaux
|
||||
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
||||
Contact: michel.peltriaux@sgdnord.rlp.de
|
||||
Created on: 04.01.22
|
||||
|
||||
"""
|
||||
import datetime
|
||||
|
||||
from django.contrib.gis.db.models.functions import Area
|
||||
|
||||
from konova.management.commands.setup import BaseKonovaCommand
|
||||
from konova.models import Geometry, Parcel, District
|
||||
|
||||
|
||||
class Command(BaseKonovaCommand):
|
||||
help = "Checks the database' sanity and removes unused entries"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
try:
|
||||
self.update_all_parcels()
|
||||
except KeyboardInterrupt:
|
||||
self._break_line()
|
||||
exit(-1)
|
||||
|
||||
def update_all_parcels(self):
|
||||
num_parcels_before = Parcel.objects.count()
|
||||
num_districts_before = District.objects.count()
|
||||
self._write_warning("=== Update parcels and districts ===")
|
||||
# Order geometries by size to process smaller once at first
|
||||
geometries = Geometry.objects.all().exclude(
|
||||
geom=None
|
||||
).annotate(area=Area("geom")).order_by(
|
||||
'area'
|
||||
)
|
||||
self._write_warning(f"Process parcels for {geometries.count()} geometry entries now ...")
|
||||
i = 0
|
||||
num_geoms = geometries.count()
|
||||
for geometry in geometries:
|
||||
self._write_warning(f"--- {datetime.datetime.now()} Process {geometry.id} now ...")
|
||||
geometry.update_parcels()
|
||||
self._write_warning(f"--- Processed {geometry.get_underlying_parcels().count()} underlying parcels")
|
||||
i += 1
|
||||
self._write_warning(f"--- {i}/{num_geoms} processed")
|
||||
|
||||
num_parcels_after = Parcel.objects.count()
|
||||
num_districts_after = District.objects.count()
|
||||
if num_parcels_after != num_parcels_before:
|
||||
self._write_error(f"Parcels have changed: {num_parcels_before} to {num_parcels_after} entries. You should run the sanitize command.")
|
||||
if num_districts_after != num_districts_before:
|
||||
self._write_error(f"Districts have changed: {num_districts_before} to {num_districts_after} entries. You should run the sanitize command.")
|
||||
|
||||
self._write_success("Updating parcels done!")
|
||||
self._break_line()
|
||||
@@ -8,7 +8,7 @@ Created on: 15.11.21
|
||||
import json
|
||||
|
||||
from django.contrib.gis.db.models import MultiPolygonField
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
|
||||
from django.db import models, transaction
|
||||
from django.utils import timezone
|
||||
|
||||
@@ -223,6 +223,17 @@ class Geometry(BaseResource):
|
||||
)
|
||||
parcel_obj.updated_on = _now
|
||||
parcels_to_update.append(parcel_obj)
|
||||
except MultipleObjectsReturned:
|
||||
parcel_obj = Parcel.make_unique(
|
||||
district=district,
|
||||
municipal=municipal,
|
||||
parcel_group=parcel_group,
|
||||
flr=flr_val,
|
||||
flrstck_nnr=flrstck_nnr,
|
||||
flrstck_zhlr=flrstck_zhlr,
|
||||
)
|
||||
parcel_obj.updated_on = _now
|
||||
parcels_to_update.append(parcel_obj)
|
||||
except ObjectDoesNotExist:
|
||||
# If not existing, create object but do not commit, yet
|
||||
parcel_obj = Parcel(
|
||||
@@ -366,11 +377,10 @@ class Geometry(BaseResource):
|
||||
diff = geom_envelope - self.geom
|
||||
|
||||
if diff.area == 0:
|
||||
ratio = 1
|
||||
complexity_factor = 1
|
||||
else:
|
||||
ratio = self.geom.area / diff.area
|
||||
complexity_factor = self.geom.area / diff.area
|
||||
|
||||
complexity_factor = 1 - ratio
|
||||
return complexity_factor
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de
|
||||
Created on: 16.12.21
|
||||
|
||||
"""
|
||||
from django.db import models
|
||||
from django.db import models, transaction
|
||||
|
||||
from konova.models import UuidModel
|
||||
|
||||
@@ -158,6 +158,46 @@ class Parcel(UuidModel):
|
||||
def __str__(self):
|
||||
return f"{self.parcel_group} | {self.flr} | {self.flrstck_zhlr} | {self.flrstck_nnr}"
|
||||
|
||||
@classmethod
|
||||
def make_unique(cls, **kwargs):
|
||||
""" Checks for duplicates of a Parcel, choose a (now) unique one,
|
||||
repairs relations for ParcelIntersection and removes duplicates.
|
||||
|
||||
Args:
|
||||
**kwargs ():
|
||||
|
||||
Returns:
|
||||
unique_true (Parcel): The new unique 'true one'
|
||||
"""
|
||||
parcel_objs = Parcel.objects.filter(**kwargs)
|
||||
|
||||
if not parcel_objs.exists():
|
||||
return None
|
||||
|
||||
# Get one of the found parcels and use it as new 'true one'
|
||||
unique_parcel = parcel_objs.first()
|
||||
# separate it from the rest
|
||||
parcel_objs = parcel_objs.exclude(id=unique_parcel.id)
|
||||
|
||||
if not parcel_objs.exists():
|
||||
# There are no duplicates - all good, just return
|
||||
return unique_parcel
|
||||
|
||||
# Fetch existing intersections, which still point on the duplicated parcels
|
||||
intersection_objs = ParcelIntersection.objects.filter(
|
||||
parcel__in=parcel_objs
|
||||
)
|
||||
|
||||
# Change each intersection, so they point on the 'true one' parcel from now on
|
||||
for intersection in intersection_objs:
|
||||
intersection.parcel = unique_parcel
|
||||
intersection.save()
|
||||
|
||||
# Remove the duplicated parcels
|
||||
parcel_objs.delete()
|
||||
|
||||
return unique_parcel
|
||||
|
||||
|
||||
class ParcelIntersection(UuidModel):
|
||||
"""
|
||||
|
||||
@@ -5,6 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de
|
||||
Created on: 31.01.22
|
||||
|
||||
"""
|
||||
from konova.sub_settings.django_settings import env
|
||||
|
||||
# MAPS
|
||||
DEFAULT_LAT = 50.00
|
||||
@@ -28,3 +29,6 @@ LANIS_ZOOM_LUT = {
|
||||
1000: 30,
|
||||
500: 31,
|
||||
}
|
||||
|
||||
MAP_PROXY_HOST_WHITELIST = env.list("MAP_PROXY_HOST_WHITELIST")
|
||||
i = 0
|
||||
@@ -16,3 +16,5 @@ OAUTH_CODE_VERIFIER = env("OAUTH_CODE_VERIFIER")
|
||||
|
||||
OAUTH_CLIENT_ID = env("OAUTH_CLIENT_ID")
|
||||
OAUTH_CLIENT_SECRET = env("OAUTH_CLIENT_SECRET")
|
||||
|
||||
PROPAGATION_SECRET = env("PROPAGATION_SECRET")
|
||||
|
||||
@@ -55,11 +55,11 @@ class ParcelFetcher:
|
||||
content = json.loads(response.content.decode("utf-8"))
|
||||
except JSONDecodeError:
|
||||
content = {}
|
||||
next = content.get("next", None)
|
||||
_next = content.get("next", None)
|
||||
fetched_parcels = content.get("results", [])
|
||||
self.results += fetched_parcels
|
||||
|
||||
if next:
|
||||
self.get_parcels(next)
|
||||
if _next:
|
||||
self.get_parcels(_next)
|
||||
|
||||
return self.results
|
||||
@@ -216,11 +216,11 @@ class TableRenderMixin:
|
||||
|
||||
"""
|
||||
html = ""
|
||||
has_access = record.is_shared_with(self.user)
|
||||
is_entry_shared = record.is_shared_with(self.user)
|
||||
|
||||
html += self.render_icn(
|
||||
tooltip=_("Full access granted") if has_access else _("Access not granted"),
|
||||
icn_class="fas fa-edit rlp-r-inv" if has_access else "far fa-edit",
|
||||
tooltip=_("Full access granted") if is_entry_shared else _("Access not granted"),
|
||||
icn_class="fas fa-edit rlp-r-inv" if is_entry_shared else "far fa-edit",
|
||||
)
|
||||
return format_html(html)
|
||||
|
||||
|
||||
@@ -24,5 +24,13 @@ class LogoutView(View):
|
||||
Returns:
|
||||
A redirect
|
||||
"""
|
||||
user = request.user
|
||||
try:
|
||||
oauth_token = user.oauth_token
|
||||
if oauth_token:
|
||||
oauth_token.revoke()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
logout(request)
|
||||
return redirect(SSO_SERVER_BASE)
|
||||
|
||||
@@ -9,6 +9,7 @@ import json
|
||||
from json import JSONDecodeError
|
||||
|
||||
import requests
|
||||
import urllib3.util
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.http import JsonResponse, HttpRequest
|
||||
from django.utils.decorators import method_decorator
|
||||
@@ -18,6 +19,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from requests.auth import HTTPDigestAuth
|
||||
|
||||
from konova.sub_settings.lanis_settings import MAP_PROXY_HOST_WHITELIST
|
||||
from konova.sub_settings.proxy_settings import PROXIES, GEOPORTAL_RLP_USER, GEOPORTAL_RLP_PASSWORD
|
||||
|
||||
|
||||
@@ -32,6 +34,13 @@ class BaseClientProxyView(View):
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
def _check_with_whitelist(self, url):
|
||||
parsed_url = urllib3.util.parse_url(url)
|
||||
parsed_url_host = parsed_url.host
|
||||
whitelist = set(MAP_PROXY_HOST_WHITELIST)
|
||||
is_allowed = parsed_url_host in whitelist
|
||||
return is_allowed
|
||||
|
||||
def perform_url_call(self, url, headers={}, auth=None):
|
||||
""" Generic proxied call
|
||||
|
||||
@@ -59,6 +68,11 @@ class ClientProxyParcelSearch(BaseClientProxyView):
|
||||
|
||||
def get(self, request: HttpRequest):
|
||||
url = request.META.get("QUERY_STRING")
|
||||
|
||||
is_url_allowed = self._check_with_whitelist(url)
|
||||
if not is_url_allowed:
|
||||
raise PermissionError(f"Proxied url '{url}' is not allowed!")
|
||||
|
||||
content, response_code = self.perform_url_call(url)
|
||||
try:
|
||||
body = json.loads(content)
|
||||
|
||||
@@ -115,10 +115,10 @@ class OAuthCallbackView(View):
|
||||
if status_code_invalid:
|
||||
raise RuntimeError(f"OAuth access token could not be fetched: {access_code_response.text}")
|
||||
|
||||
oauth_access_token = OAuthToken.from_access_token_response(access_code_response_body, received_on)
|
||||
oauth_access_token.save()
|
||||
user = oauth_access_token.update_and_get_user()
|
||||
user.oauth_replace_token(oauth_access_token)
|
||||
oauth_token = OAuthToken.from_access_token_response(access_code_response_body, received_on)
|
||||
oauth_token.save()
|
||||
user = oauth_token.update_and_get_user()
|
||||
user.oauth_replace_token(oauth_token)
|
||||
|
||||
login(request, user)
|
||||
return redirect("home")
|
||||
|
||||
Binary file not shown.
@@ -29,6 +29,7 @@
|
||||
#: konova/filters/mixins/office.py:25 konova/filters/mixins/office.py:56
|
||||
#: konova/filters/mixins/office.py:57 konova/filters/mixins/record.py:23
|
||||
#: konova/filters/mixins/self_created.py:24 konova/filters/mixins/share.py:23
|
||||
#: konova/filters/mixins/user_log.py:17 konova/filters/mixins/user_log.py:18
|
||||
#: konova/forms/geometry_form.py:32 konova/forms/modals/document_form.py:26
|
||||
#: konova/forms/modals/document_form.py:36
|
||||
#: konova/forms/modals/document_form.py:50
|
||||
@@ -43,7 +44,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-02-16 09:49+0100\n"
|
||||
"POT-Creation-Date: 2024-08-19 10:32+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -259,7 +260,7 @@ msgstr ""
|
||||
|
||||
#: analysis/templates/analysis/reports/includes/eco_account/deductions.html:14
|
||||
#: analysis/templates/analysis/reports/includes/eco_account/deductions.html:16
|
||||
#: compensation/forms/modals/state.py:58
|
||||
#: compensation/forms/modals/state.py:59
|
||||
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:36
|
||||
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:36
|
||||
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:36
|
||||
@@ -447,7 +448,7 @@ msgid "Select the intervention for which this compensation compensates"
|
||||
msgstr "Wählen Sie den Eingriff, für den diese Kompensation bestimmt ist"
|
||||
|
||||
#: compensation/forms/compensation.py:114
|
||||
#: compensation/views/compensation/compensation.py:119
|
||||
#: compensation/views/compensation/compensation.py:120
|
||||
msgid "New compensation"
|
||||
msgstr "Neue Kompensation"
|
||||
|
||||
@@ -474,7 +475,7 @@ msgid "When did the parties agree on this?"
|
||||
msgstr "Wann wurde dieses Ökokonto offiziell vereinbart?"
|
||||
|
||||
#: compensation/forms/eco_account.py:72
|
||||
#: compensation/views/eco_account/eco_account.py:100
|
||||
#: compensation/views/eco_account/eco_account.py:101
|
||||
msgid "New Eco-Account"
|
||||
msgstr "Neues Ökokonto"
|
||||
|
||||
@@ -696,46 +697,46 @@ msgid "If there is no date you can enter, please explain why."
|
||||
msgstr "Falls Sie kein Datum angeben können, erklären Sie bitte weshalb."
|
||||
|
||||
#: compensation/forms/modals/payment.py:108
|
||||
#: intervention/templates/intervention/detail/includes/payments.html:59
|
||||
#: intervention/templates/intervention/detail/includes/payments.html:67
|
||||
msgid "Edit payment"
|
||||
msgstr "Zahlung bearbeiten"
|
||||
|
||||
#: compensation/forms/modals/state.py:32
|
||||
#: compensation/forms/modals/state.py:33
|
||||
msgid "Biotope Type"
|
||||
msgstr "Biotoptyp"
|
||||
|
||||
#: compensation/forms/modals/state.py:35
|
||||
#: compensation/forms/modals/state.py:36
|
||||
msgid "Select the biotope type"
|
||||
msgstr "Biotoptyp wählen"
|
||||
|
||||
#: compensation/forms/modals/state.py:39 compensation/forms/modals/state.py:51
|
||||
#: compensation/forms/modals/state.py:40 compensation/forms/modals/state.py:52
|
||||
msgid "Biotope additional type"
|
||||
msgstr "Zusatzbezeichnung"
|
||||
|
||||
#: compensation/forms/modals/state.py:42
|
||||
#: compensation/forms/modals/state.py:43
|
||||
msgid "Select an additional biotope type"
|
||||
msgstr "Zusatzbezeichnung wählen"
|
||||
|
||||
#: compensation/forms/modals/state.py:61
|
||||
#: compensation/forms/modals/state.py:62
|
||||
#: intervention/forms/modals/deduction.py:49
|
||||
msgid "in m²"
|
||||
msgstr ""
|
||||
|
||||
#: compensation/forms/modals/state.py:72
|
||||
#: compensation/forms/modals/state.py:73
|
||||
#: compensation/tests/compensation/unit/test_forms.py:175
|
||||
msgid "New state"
|
||||
msgstr "Neuer Zustand"
|
||||
|
||||
#: compensation/forms/modals/state.py:73
|
||||
#: compensation/forms/modals/state.py:74
|
||||
#: compensation/tests/compensation/unit/test_forms.py:176
|
||||
msgid "Insert data for the new state"
|
||||
msgstr "Geben Sie die Daten des neuen Zustandes ein"
|
||||
|
||||
#: compensation/forms/modals/state.py:90 konova/forms/modals/base_form.py:32
|
||||
#: compensation/forms/modals/state.py:91 konova/forms/modals/base_form.py:32
|
||||
msgid "Object removed"
|
||||
msgstr "Objekt entfernt"
|
||||
|
||||
#: compensation/forms/modals/state.py:145
|
||||
#: compensation/forms/modals/state.py:146
|
||||
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:62
|
||||
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:62
|
||||
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:62
|
||||
@@ -1287,44 +1288,44 @@ msgstr ""
|
||||
msgid "Responsible data"
|
||||
msgstr "Daten zu den verantwortlichen Stellen"
|
||||
|
||||
#: compensation/views/compensation/compensation.py:57
|
||||
#: compensation/views/compensation/compensation.py:58
|
||||
msgid "Compensations - Overview"
|
||||
msgstr "Kompensationen - Übersicht"
|
||||
|
||||
#: compensation/views/compensation/compensation.py:180
|
||||
#: compensation/views/compensation/compensation.py:181
|
||||
#: konova/utils/message_templates.py:40
|
||||
msgid "Compensation {} edited"
|
||||
msgstr "Kompensation {} bearbeitet"
|
||||
|
||||
#: compensation/views/compensation/compensation.py:195
|
||||
#: compensation/views/eco_account/eco_account.py:172 ema/views/ema.py:230
|
||||
#: intervention/views/intervention.py:251
|
||||
#: compensation/views/compensation/compensation.py:196
|
||||
#: compensation/views/eco_account/eco_account.py:173 ema/views/ema.py:232
|
||||
#: intervention/views/intervention.py:253
|
||||
msgid "Edit {}"
|
||||
msgstr "Bearbeite {}"
|
||||
|
||||
#: compensation/views/compensation/report.py:34
|
||||
#: compensation/views/eco_account/report.py:34 ema/views/report.py:34
|
||||
#: intervention/views/report.py:37
|
||||
#: intervention/views/report.py:35
|
||||
msgid "Report {}"
|
||||
msgstr "Bericht {}"
|
||||
|
||||
#: compensation/views/eco_account/eco_account.py:52
|
||||
#: compensation/views/eco_account/eco_account.py:53
|
||||
msgid "Eco-account - Overview"
|
||||
msgstr "Ökokonten - Übersicht"
|
||||
|
||||
#: compensation/views/eco_account/eco_account.py:85
|
||||
#: compensation/views/eco_account/eco_account.py:86
|
||||
msgid "Eco-Account {} added"
|
||||
msgstr "Ökokonto {} hinzugefügt"
|
||||
|
||||
#: compensation/views/eco_account/eco_account.py:157
|
||||
#: compensation/views/eco_account/eco_account.py:158
|
||||
msgid "Eco-Account {} edited"
|
||||
msgstr "Ökokonto {} bearbeitet"
|
||||
|
||||
#: compensation/views/eco_account/eco_account.py:286
|
||||
#: compensation/views/eco_account/eco_account.py:288
|
||||
msgid "Eco-account removed"
|
||||
msgstr "Ökokonto entfernt"
|
||||
|
||||
#: ema/forms.py:42 ema/tests/unit/test_forms.py:27 ema/views/ema.py:101
|
||||
#: ema/forms.py:42 ema/tests/unit/test_forms.py:27 ema/views/ema.py:102
|
||||
msgid "New EMA"
|
||||
msgstr "Neue EMA hinzufügen"
|
||||
|
||||
@@ -1352,19 +1353,19 @@ msgstr ""
|
||||
msgid "Payment funded compensation"
|
||||
msgstr "Ersatzzahlungsmaßnahme"
|
||||
|
||||
#: ema/views/ema.py:52
|
||||
#: ema/views/ema.py:53
|
||||
msgid "EMAs - Overview"
|
||||
msgstr "EMAs - Übersicht"
|
||||
|
||||
#: ema/views/ema.py:85
|
||||
#: ema/views/ema.py:86
|
||||
msgid "EMA {} added"
|
||||
msgstr "EMA {} hinzugefügt"
|
||||
|
||||
#: ema/views/ema.py:215
|
||||
#: ema/views/ema.py:217
|
||||
msgid "EMA {} edited"
|
||||
msgstr "EMA {} bearbeitet"
|
||||
|
||||
#: ema/views/ema.py:254
|
||||
#: ema/views/ema.py:256
|
||||
msgid "EMA removed"
|
||||
msgstr "EMA entfernt"
|
||||
|
||||
@@ -1428,7 +1429,7 @@ msgstr "Datum Bestandskraft bzw. Rechtskraft"
|
||||
|
||||
#: intervention/forms/intervention.py:216
|
||||
#: intervention/tests/unit/test_forms.py:36
|
||||
#: intervention/views/intervention.py:104
|
||||
#: intervention/views/intervention.py:105
|
||||
msgid "New intervention"
|
||||
msgstr "Neuer Eingriff"
|
||||
|
||||
@@ -1597,7 +1598,12 @@ msgctxt "money"
|
||||
msgid "Amount"
|
||||
msgstr "Betrag"
|
||||
|
||||
#: intervention/templates/intervention/detail/includes/payments.html:62
|
||||
#: intervention/templates/intervention/detail/includes/payments.html:61
|
||||
#: konova/utils/message_templates.py:25
|
||||
msgid "This data is not shared with you"
|
||||
msgstr "Diese Daten sind für Sie nicht freigegeben"
|
||||
|
||||
#: intervention/templates/intervention/detail/includes/payments.html:70
|
||||
msgid "Remove payment"
|
||||
msgstr "Zahlung entfernen"
|
||||
|
||||
@@ -1659,19 +1665,19 @@ msgstr ""
|
||||
msgid "Check performed"
|
||||
msgstr "Prüfung durchgeführt"
|
||||
|
||||
#: intervention/views/intervention.py:56
|
||||
#: intervention/views/intervention.py:57
|
||||
msgid "Interventions - Overview"
|
||||
msgstr "Eingriffe - Übersicht"
|
||||
|
||||
#: intervention/views/intervention.py:89
|
||||
#: intervention/views/intervention.py:90
|
||||
msgid "Intervention {} added"
|
||||
msgstr "Eingriff {} hinzugefügt"
|
||||
|
||||
#: intervention/views/intervention.py:234
|
||||
#: intervention/views/intervention.py:236
|
||||
msgid "Intervention {} edited"
|
||||
msgstr "Eingriff {} bearbeitet"
|
||||
|
||||
#: intervention/views/intervention.py:276
|
||||
#: intervention/views/intervention.py:278
|
||||
msgid "{} removed"
|
||||
msgstr "{} entfernt"
|
||||
|
||||
@@ -1781,6 +1787,17 @@ msgstr ""
|
||||
"Wenn aktiviert werden auch Einträge angezeigt, die nicht für Sie freigegeben "
|
||||
"sind"
|
||||
|
||||
#: konova/filters/mixins/user_log.py:21
|
||||
msgid "Logged user"
|
||||
msgstr "Bearbeitender Nutzer"
|
||||
|
||||
#: konova/filters/mixins/user_log.py:22
|
||||
msgid ""
|
||||
"Search for entries where this person has been participated according to log "
|
||||
"history"
|
||||
msgstr ""
|
||||
"Sucht nach Einträgen, an denen diese Person gearbeitet hat"
|
||||
|
||||
#: konova/forms/base_form.py:23 templates/form/collapsable/form.html:62
|
||||
msgid "Save"
|
||||
msgstr "Speichern"
|
||||
@@ -1911,11 +1928,11 @@ msgstr "Kontrolle am"
|
||||
msgid "Other"
|
||||
msgstr "Sonstige"
|
||||
|
||||
#: konova/sub_settings/django_settings.py:166
|
||||
#: konova/sub_settings/django_settings.py:157
|
||||
msgid "German"
|
||||
msgstr ""
|
||||
|
||||
#: konova/sub_settings/django_settings.py:167
|
||||
#: konova/sub_settings/django_settings.py:158
|
||||
msgid "English"
|
||||
msgstr ""
|
||||
|
||||
@@ -2091,10 +2108,6 @@ msgstr ""
|
||||
"Eintrag ist verzeichnet. Um Daten zu bearbeiten, muss der Eintrag erst "
|
||||
"entzeichnet werden."
|
||||
|
||||
#: konova/utils/message_templates.py:25
|
||||
msgid "This data is not shared with you"
|
||||
msgstr "Diese Daten sind für Sie nicht freigegeben"
|
||||
|
||||
#: konova/utils/message_templates.py:26
|
||||
msgid ""
|
||||
"Remember: This data has not been shared with you, yet. This means you can "
|
||||
@@ -2817,11 +2830,17 @@ msgstr "Mehr"
|
||||
msgid "Reports"
|
||||
msgstr "Berichte"
|
||||
|
||||
#: templates/navbars/navbar.html:56 user/templates/user/index.html:31
|
||||
#: templates/navbars/navbar.html:57
|
||||
#, fuzzy
|
||||
#| msgid "Admins"
|
||||
msgid "Admin"
|
||||
msgstr "Administratoren"
|
||||
|
||||
#: templates/navbars/navbar.html:59 user/templates/user/index.html:31
|
||||
msgid "Settings"
|
||||
msgstr "Einstellungen"
|
||||
|
||||
#: templates/navbars/navbar.html:57
|
||||
#: templates/navbars/navbar.html:60
|
||||
msgid "Logout"
|
||||
msgstr "Abmelden"
|
||||
|
||||
@@ -3032,7 +3051,7 @@ msgid "Manage teams"
|
||||
msgstr ""
|
||||
|
||||
#: user/templates/user/index.html:53 user/templates/user/team/index.html:19
|
||||
#: user/views.py:171
|
||||
#: user/views/views.py:171
|
||||
msgid "Teams"
|
||||
msgstr ""
|
||||
|
||||
@@ -3084,43 +3103,43 @@ msgstr "Token noch nicht freigeschaltet"
|
||||
msgid "Valid until"
|
||||
msgstr "Läuft ab am"
|
||||
|
||||
#: user/views.py:35
|
||||
#: user/views/views.py:35
|
||||
msgid "User settings"
|
||||
msgstr "Einstellungen"
|
||||
|
||||
#: user/views.py:61
|
||||
#: user/views/views.py:61
|
||||
msgid "Notifications edited"
|
||||
msgstr "Benachrichtigungen bearbeitet"
|
||||
|
||||
#: user/views.py:73
|
||||
#: user/views/views.py:73
|
||||
msgid "User notifications"
|
||||
msgstr "Benachrichtigungen"
|
||||
|
||||
#: user/views.py:96
|
||||
#: user/views/views.py:96
|
||||
msgid "New token generated. Administrators need to validate."
|
||||
msgstr "Neuer Token generiert. Administratoren sind informiert."
|
||||
|
||||
#: user/views.py:107
|
||||
#: user/views/views.py:107
|
||||
msgid "User API token"
|
||||
msgstr "API Nutzer Token"
|
||||
|
||||
#: user/views.py:183
|
||||
#: user/views/views.py:183
|
||||
msgid "New team added"
|
||||
msgstr "Neues Team hinzugefügt"
|
||||
|
||||
#: user/views.py:198
|
||||
#: user/views/views.py:198
|
||||
msgid "Team edited"
|
||||
msgstr "Team bearbeitet"
|
||||
|
||||
#: user/views.py:213
|
||||
#: user/views/views.py:213
|
||||
msgid "Team removed"
|
||||
msgstr "Team gelöscht"
|
||||
|
||||
#: user/views.py:228
|
||||
#: user/views/views.py:228
|
||||
msgid "You are not a member of this team"
|
||||
msgstr "Sie sind kein Mitglied dieses Teams"
|
||||
|
||||
#: user/views.py:235
|
||||
#: user/views/views.py:235
|
||||
msgid "Left Team"
|
||||
msgstr "Team verlassen"
|
||||
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
amqp==5.2.0
|
||||
amqp==5.3.1
|
||||
asgiref==3.8.1
|
||||
async-timeout==4.0.3
|
||||
async-timeout==5.0.1
|
||||
beautifulsoup4==4.13.0b2
|
||||
billiard==4.2.0
|
||||
cached-property==1.5.2
|
||||
billiard==4.2.1
|
||||
cached-property==2.0.1
|
||||
celery==5.4.0
|
||||
certifi==2024.7.4
|
||||
cffi==1.17.0
|
||||
certifi==2024.12.14
|
||||
cffi==1.17.1
|
||||
chardet==5.2.0
|
||||
charset-normalizer==3.3.2
|
||||
click==8.1.7
|
||||
charset-normalizer==3.4.0
|
||||
click==8.1.8
|
||||
click-didyoumean==0.3.1
|
||||
click-plugins==1.1.1
|
||||
click-repl==0.3.0
|
||||
coverage==7.5.4
|
||||
cryptography==43.0.0
|
||||
Deprecated==1.2.14
|
||||
Django==5.0.8
|
||||
coverage==7.6.9
|
||||
cryptography==44.0.0
|
||||
Deprecated==1.2.15
|
||||
Django==5.1.4
|
||||
django-autocomplete-light==3.11.0
|
||||
django-bootstrap-modal-forms==3.0.4
|
||||
django-bootstrap4==24.3
|
||||
django-bootstrap-modal-forms==3.0.5
|
||||
django-bootstrap4==24.4
|
||||
django-environ==0.11.2
|
||||
django-filter==24.3
|
||||
django-fontawesome-5==1.0.18
|
||||
django-oauth-toolkit==2.4.0
|
||||
django-oauth-toolkit==3.0.1
|
||||
django-simple-sso==1.2.0
|
||||
django-tables2==2.7.0
|
||||
et-xmlfile==1.1.0
|
||||
gunicorn==22.0.0
|
||||
idna==3.7
|
||||
importlib_metadata==8.2.0
|
||||
django-tables2==2.7.1
|
||||
et_xmlfile==2.0.0
|
||||
gunicorn==23.0.0
|
||||
idna==3.10
|
||||
importlib_metadata==8.5.0
|
||||
itsdangerous==0.24
|
||||
jwcrypto==1.5.6
|
||||
kombu==5.4.0rc1
|
||||
oauthlib==3.2.2
|
||||
openpyxl==3.2.0b1
|
||||
packaging==24.1
|
||||
packaging==24.2
|
||||
pika==1.3.2
|
||||
pillow==10.4.0
|
||||
prompt_toolkit==3.0.47
|
||||
psycopg==3.2.1
|
||||
psycopg-binary==3.2.1
|
||||
pillow==11.0.0
|
||||
prompt_toolkit==3.0.48
|
||||
psycopg==3.2.3
|
||||
psycopg-binary==3.2.3
|
||||
pycparser==2.22
|
||||
pyparsing==3.1.2
|
||||
pyparsing==3.2.0
|
||||
pypng==0.20220715.0
|
||||
pyproj==3.6.1
|
||||
pyproj==3.7.0
|
||||
python-dateutil==2.9.0.post0
|
||||
pytz==2024.1
|
||||
pytz==2024.2
|
||||
PyYAML==6.0.2
|
||||
qrcode==7.3.1
|
||||
redis==5.1.0b6
|
||||
@@ -55,11 +55,11 @@ six==1.16.0
|
||||
soupsieve==2.5
|
||||
sqlparse==0.5.1
|
||||
typing_extensions==4.12.2
|
||||
tzdata==2024.1
|
||||
urllib3==2.2.2
|
||||
tzdata==2024.2
|
||||
urllib3==2.3.0
|
||||
vine==5.1.0
|
||||
wcwidth==0.2.13
|
||||
webservices==0.7
|
||||
wrapt==1.16.0
|
||||
xmltodict==0.13.0
|
||||
zipp==3.19.2
|
||||
xmltodict==0.14.2
|
||||
zipp==3.21.0
|
||||
|
||||
@@ -16,7 +16,7 @@ from django.utils.decorators import method_decorator
|
||||
from django.views import View
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
from konova.sub_settings.sso_settings import OAUTH_CLIENT_ID
|
||||
from konova.sub_settings.sso_settings import PROPAGATION_SECRET
|
||||
from user.models import User
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ class PropagateUserView(View):
|
||||
def post(self, request: HttpRequest, *args, **kwargs):
|
||||
# Decrypt
|
||||
encrypted_body = request.body
|
||||
hash = hashlib.md5()
|
||||
hash.update(OAUTH_CLIENT_ID.encode("utf-8"))
|
||||
key = base64.urlsafe_b64encode(hash.hexdigest().encode("utf-8"))
|
||||
_hash = hashlib.md5()
|
||||
_hash.update(PROPAGATION_SECRET.encode("utf-8"))
|
||||
key = base64.urlsafe_b64encode(_hash.hexdigest().encode("utf-8"))
|
||||
fernet = Fernet(key)
|
||||
body = fernet.decrypt(encrypted_body).decode("utf-8")
|
||||
body = json.loads(body)
|
||||
|
||||
Reference in New Issue
Block a user