Skip to content

Commit 48ed82f

Browse files
authored
Merge pull request #149 from nuest/feature/improve_privacy_117
2 parents 645db4c + 395f012 commit 48ed82f

File tree

13 files changed

+50
-66
lines changed

13 files changed

+50
-66
lines changed

optimap/settings.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,13 @@
141141
Q_CLUSTER = {
142142
'name': 'optimap',
143143
'workers': 1,
144-
'timeout': 10,
145-
'retry': 20,
144+
'timeout': 60 * 10, # seconds, must be less than retry
145+
'retry': 60 * 11,
146+
'save_limit': 0, # unlimited
146147
'queue_limit': 50,
147148
'bulk': 10,
148149
'orm': 'default',
149-
'ack_failures': True,
150-
'max_attempts': 5,
151-
'attempt_count': 0,
150+
'max_attempts': 5
152151
}
153152

154153
CACHES = {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 5.1.9 on 2025-05-21 13:35
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('publications', '0002_source_collection_name_source_tags'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='customuser',
15+
name='deleted',
16+
),
17+
migrations.RemoveField(
18+
model_name='customuser',
19+
name='deleted_at',
20+
),
21+
]

publications/models.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,9 @@
2222
)
2323

2424
class CustomUser(AbstractUser):
25-
deleted = models.BooleanField(default=False)
26-
deleted_at = models.DateTimeField(null=True, blank=True)
2725
groups = models.ManyToManyField(Group, related_name="publications_users", blank=True)
2826
user_permissions = models.ManyToManyField(Permission, related_name="publications_users_permissions", blank=True)
2927

30-
def soft_delete(self):
31-
"""Marks the user as deleted instead of removing from the database."""
32-
self.deleted = True
33-
self.deleted_at = now()
34-
self.save()
35-
logger.info(f"User {self.username} (ID: {self.id}) was soft deleted at {self.deleted_at}")
36-
37-
38-
def restore(self):
39-
"""Restores a previously deleted user."""
40-
self.deleted = False
41-
self.deleted_at = None
42-
self.save()
43-
logger.info(f"User {self.username} (ID: {self.id}) was restored.")
44-
4528
class Publication(models.Model):
4629
# required fields
4730
title = models.TextField()

publications/serializers.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,3 @@ class UserSerializer(serializers.ModelSerializer):
4545
class Meta:
4646
model = User
4747
fields = ["id", "username", "email"]
48-
49-
def to_representation(self, instance):
50-
"""Ensure deleted users are excluded from serialization."""
51-
if instance.deleted:
52-
return None
53-
return super().to_representation(instance)

publications/templates/imprint.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ <h2>Contact</h2>
55
Professur für Geoinformatik - KOMET project team</br>
66
Helmholtzstr. 10</br>
77
D-01069 Dresden</br>
8-
8+
Email: <a href="mailto:[email protected]">[email protected]</a>
99
</p>
1010
<h2>Responsible for the content</h2>
1111
<p>Dr. Daniel Nüst</br>

publications/templates/menu_snippet.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
id="navbarDarkDropdown1"
66
role="button"
77
data-toggle="dropdown"
8-
aria-expanded="false"
9-
>
8+
aria-expanded="false">
109
<i class="fa-solid fa-circle-user fa-3x"></i>
1110
</a>
1211
<ul
1312
class="dropdown-menu dropdown-menu-right"
14-
aria-labelledby="navbarDarkDropdown1"
15-
>
16-
<span class="dropdown-item-text"
17-
>New around here? Please login to create a new account.</span
18-
>
13+
aria-labelledby="navbarDarkDropdown1">
14+
<span class="dropdown-item-text">New around here? Please login to create a new account.</span>
15+
<span class="dropdown-item-text">Want to stay anonymous? Use a public inbox like <a href="https://www.mailinator.com/">Mailinator</a> or check out our <a href="{% url 'optimap:privacy' %}">privacy information</a>.</span>
1916
<div class="dropdown-divider"></div>
2017
<li class="px-3 py-2">
2118
<form class="form" method="POST" action="{% url 'optimap:loginres' %}">

publications/templates/privacy.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,30 @@ <h1 class="py-2">Privacy policy</h1>
1111
<p class="lead">OPTIMAP does not collect or log your personal data. We only store your email to identify your user
1212
account and minimal metadata, such as the date of registration and the last login, to identify and handle stale accounts.</p>
1313

14-
<p>The address of the website is {{ site | urlize }}.</p>
14+
<p>You can use OPTIMAP fully anonymously by using a public inbox, such as <a href="https://www.mailinator.com/" title="Link to Mailinator">Mailinator</a>.</p>
1515

16-
<p>This website does not use any cookies to track users, with the exception of the login status, to which users
16+
<p>This website does not use any cookies to track users or any third-party tracking services (such as Google Analytics or similar), with the exception of the login status, to which users
1717
provide implicit concent by opening an account on the website.</p>
1818

1919
<p>This website utilizes map services provided by the OpenStreetMap Foundation, St John's Innovation Centre, Cowley
2020
Road, Cambridge, CB4 0WS, United Kingdom (short OSMF). Your Internet browser or application will connect to
21-
servers operated by the OSMF located in the United Kingdom and in other countries. The operator of this site has
21+
servers operated by the OSMF located in the United login and in other countries. The operator of this site has
2222
no control over such connections and processing of your data by the OSMF. You can find more information on the
2323
processing of user data by the OSMF in the <a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy">OSMF
2424
privacy policy</a>.
2525
This website integrates the OSMF services exclusively for the legitimate interest (cf. article 6.1f of the GDPR)
2626
of displaying the map functions to the users of the website for interactive exploration of the presented datasets.
2727
</p>
2828

29+
<p>You can <strong>delete</strong> your account yourself after logging in (Settings > Delete account), which will deactivate all notifications and feeds.
30+
Stale accounts that have not been used in over a year are automatically deleted after a final warning email.</p>
31+
2932
<h1 class="py-2">Notice of liability</h1>
3033
<p>Although we check the content carefully, we cannot accept responsibility for the content of external links. The
3134
linked sites' carriers are responsible for their sites' content.</p>
3235

36+
<p>The address of the website is {{ site | urlize }}.</p>
37+
3338
{% include "imprint.html" %}
3439
</div>
3540
</div>

publications/templates/user_settings.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ <h5 class="modal-title">Delete Account</h5>
190190
</button>
191191
</div>
192192
<div class="modal-body">
193-
<p>Do you really want to delete this account ?</p>
193+
<p class="text-wrap text-break">Do you really want to delete this account? A confirmation email is sent to you after clicking the Delete button below.</p>
194194
</div>
195195
<div class="modal-footer">
196196
<form
@@ -200,15 +200,15 @@ <h5 class="modal-title">Delete Account</h5>
200200
{% csrf_token %}
201201
<button
202202
type="submit"
203-
class="btn btn-primary"
203+
class="btn btn-outline-danger"
204204
name="dltbutton"
205205
>
206206
Delete
207207
</button>
208208
</form>
209209
<button
210210
type="button"
211-
class="btn btn-secondary"
211+
class="btn btn-primary"
212212
data-dismiss="modal"
213213
>
214214
Close

publications/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
path('feed/', RedirectView.as_view(pattern_name='optimap:georss_feed', permanent=True)),
2626
path("loginres/", views.loginres, name="loginres"),
2727
path("privacy/", views.privacy, name="privacy"),
28+
path("contact/", RedirectView.as_view(pattern_name='optimap:privacy', permanent=True)),
29+
path("imprint/", RedirectView.as_view(pattern_name='optimap:privacy', permanent=True)),
2830
path("loginconfirm/", views.Confirmationlogin, name="loginconfirm"),
2931
path("login/<str:token>", views.authenticate_via_magic_link, name="magic_link"),
3032
path("logout/", views.customlogout, name="logout"),

publications/views.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,7 @@ def authenticate_via_magic_link(request, token):
259259
})
260260
user = User.objects.filter(email=email).first()
261261
if user:
262-
if user.deleted:
263-
user.deleted = False
264-
user.deleted_at = None
265-
user.is_active = True
266-
user.save()
267-
is_new = False
268-
else:
269-
is_new = False
262+
is_new = False
270263
else:
271264
user = User.objects.create_user(username=email, email=email)
272265
is_new = True
@@ -503,13 +496,8 @@ def finalize_account_deletion(request):
503496
messages.error(request, "You are not authorized to delete this account.")
504497
return redirect(reverse('optimap:main'))
505498
user = get_object_or_404(User, id=user_id)
506-
if user.deleted:
507-
messages.warning(request, "This account has already been deleted.")
508-
return redirect(reverse('optimap:usersettings'))
509499
try:
510-
user.deleted = True
511-
user.deleted_at = now()
512-
user.save()
500+
user.delete()
513501
logout(request)
514502
messages.success(request, "Your account has been successfully deleted.")
515503
return redirect(reverse('optimap:main'))

0 commit comments

Comments
 (0)