Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-19 Thread kaputtnik
Merged and deployed, sorry for the server errors... had forgotten to run the 
migrate command :-D
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-19 Thread GunChleoc
Let's go with Ex-Member, that's good enough for me.

I think removing the warning is fine - the warning is shown in Build 19, and 
will become obsolete in Build 20. So, warning people in-game should suffice.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-18 Thread kaputtnik
"Ancestor" = "Vorfahre" oder "Ahn"? I think that wouldn't fit.

The name has to follow the Username rules, so no space.

Ex-Member?

We could choose "anonymized" insted of "Anonymous".

One question about the online gaming password: I have removed the string 
"WARNING: The online gaming password is transmitted in cleartext. Do not use 
your website password!" AFAIK it is not transmitted in cleartext anymore? Just 
to be sure.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-18 Thread GunChleoc
Review: Approve

How about "Former Member(s)"?

Or "Ancestor(s)"? Would fit with the tribes terminology theme

I agree, don't waste too much energy into trying to write a Javascript.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-17 Thread kaputtnik
Review: Resubmit


-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-17 Thread kaputtnik
Thanks for your suggestions, all changed :)

> How about calling the deleted user "Anonymous"?

Not sure... reading "Anonymous" as a username may lead into the conclusion that 
anonymous writing is possible. My first idea for such a username was 
"Deleted_User" or "User_deleted" but i found it too long. Ideally it should be 
some name which describes the action and that makes clear that a user did it by 
himself (and not a forum moderator or admin -> censor alarm). "Self_removed" or 
so...

Regarding my comment on 2018-09-15: I wasn't able to find a solution to prevent 
writing PMs to such a user. It is a flaw of django-messages, so i filed a 
bugreport to the project -> https://github.com/arneb/django-messages/issues/118 
I did everything to prevent sending such messages: The reply buttons for 
messages are not shown, the profile page isn't shown and the autosearch for 
users when writing a string in the Recipient box will not show inactive users. 
The only solution i can think of is some javascript. But i don't think it is 
worth the work.

So from my side this can go in if we have agreed on a username to show for 
deleted users (plural ;) ). But we can change it also anytime later on.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-17 Thread GunChleoc



Diff comments:

> 
> === added file 'templates/wlprofile/delete_me.html'
> --- templates/wlprofile/delete_me.html1970-01-01 00:00:00 +
> +++ templates/wlprofile/delete_me.html2018-09-15 07:44:50 +
> @@ -0,0 +1,39 @@
> +{% extends "wlprofile/base.html" %}
> +
> +{% load i18n %}
> +{% load wlprofile_extras %}
> +
> +{% block title %}
> +{% trans "Delete me" %} - {{ block.super }}
> +{% endblock %}
> +
> +{% block content %}
> +{% trans "Delete your account" %}
> +
> +
> + Hi {{ user }},
> + we are sorry that you want to leave our community  src="/wlmedia/img/smileys/face-sad.png" alt="Sad smiley">
> + What deleting yourself means:
> + 
> + Your account will be deactivated. This means:
> + 
> + You will immediately logged out and can't 
> log in anymore.

You will be immediately logged out and unable to log in again

> + The Username "{{ user }}" is preserved and 
> can't be used anymore.

The Username "{{ user }}" will continue to be reserved, so registering again 
with that username will not be possible.

> + 
> + 
> + Your profile will be 
> deleted and your currently used image of the avatar will be deleted.

currently used avatar image

> + All your private 
> messages will be moved into the trash.
> + They stay there until the sender or recipient has also deleted 
> them.

They will stay there until such time that the sender or recipient will also 
delete them.

> + All your subscriptions will be removed.
> + Your email address will be anonymized, so you will not 
> receive any notification mails anymore.

anonymized -> removed?

> + Everything you posted (forum posts, comments and uploaded 
> maps) will not be deleted. Instead of your users name the string "{{ 
> DELETED_USERNAME }}" will be shown.

Nothing that you have posted (forum posts, comments and uploaded maps) 
will be deleted. Instead of your user name, the string "{{ DELETED_USERNAME }}" 
will be shown.

> + Your online gaming password will be reset.
> + All dates given in the Playtime scheduler will be deleted
> + 
> + This step can't be undone!
> + 
> + I am sure, please delete 
> me
> + Cancel
> + 
> +
> +{% endblock %}
> 
> === modified file 'templates/wlprofile/view_profile.html'
> --- templates/wlprofile/view_profile.html 2017-07-27 06:01:32 +
> +++ templates/wlprofile/view_profile.html 2018-09-15 07:44:50 +
> @@ -4,7 +4,13 @@
>  {% load custom_date %}
>  
>  {% block title %}
> -{{ profile.user.username }}'s Profile - {{ block.super }}
> + {% if not profile.deleted %}
> + {{ profile.user.username }}'s
> + {% else %}
> + Deleted Users Profile

Users -> User for singular Users' for plural

> + {% endif %}
> + - Profile
> + {{ block.super }}
>  {% endblock %}
>  
>  {% block content %}


-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-17 Thread GunChleoc
How about calling the deleted user "Anonymous"?
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-15 Thread kaputtnik
Review: Needs Fixing

Just found that it is still possible to write a PM to a deleted user, if the 
recipient is written by hand in the recipient field. When the 
DELETED_USER_MAILADDRESS is empty an email isn't sent, but there is no error 
message shown to the user.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-15 Thread kaputtnik
The proposal to merge lp:~widelands-dev/widelands-website/delete_user into 
lp:widelands-website has been updated.

Commit message changed to:

Make it possible to 'delete a user by himself, which means clean his data and 
show 'Deleted' in every place where a username is shown.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website

2018-09-15 Thread kaputtnik
kaputtnik has proposed merging lp:~widelands-dev/widelands-website/delete_user 
into lp:widelands-website.

Commit message:
Make it possible to 'delete a user, which means clean his data and show 
'Deleted' in every place where a username is shown.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1790307 in Widelands Website: "Make it possible to 'delete' a user"
  https://bugs.launchpad.net/widelands-website/+bug/1790307

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/delete_user/+merge/354978

Added a link in the edit profile page which switch to a page showing what 
deletion means. After clicking on 'I am sure, delete me', the following changes 
are made:

- Log the user immediately out
- Delete possible playtime scheduling dates
- Delete the Online Gaming Password
- Clean the users profile page, including physically deleting his current image 
of avatar
- Deactivate all subscriptions for this user
- Put all his PMs in the users trash
- Set the user inactive, also set 'is_staff' and 'is_superuser' to false
- Set the users E-Mail to the value of settings.DELETED_MAIL_ADDRESS
- Show the value of settings.DELETED_USERNAME in all places where a username is 
shown on the website. Wehen hovering over such a name a tooltip is shown saying 
'This user has left our community'
- Prevent sending PMs to a deleted user
- Prevent showing the users profile by directly typing the url in the browsers 
addressbar

The decision when to show the DELETED_USERNAME is done by comparing the value 
of the new boolean field 'deleted' in the model wlprofile.Profile. I have added 
this new field because other comparisons (e.g. against 'is_staff' or the 
anonymized Email address) seems a bit iffy to me.

What username should shown for a deleted user? Currently this is 'Deleted', if 
we want another name it should be consistent with the username rules, which 
means it should contain only  alphanumeric, _, @, +, . and - characters.

Just found that the DELETED_USER_MAILADDRESS can also be an empty value. I will 
set it to an empty string then.

Additional cleanup:
- Removed unused functions for feeds
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands-website/delete_user into lp:widelands-website.
=== modified file 'django_messages_wl/views.py'
--- django_messages_wl/views.py	2018-04-18 12:04:12 +
+++ django_messages_wl/views.py	2018-09-15 07:44:50 +
@@ -15,7 +15,7 @@
 if request.is_ajax():
 q = request.GET.get('term', '')
 
-usernames = User.objects.filter(username__icontains=q)
+usernames = User.objects.exclude(is_active=False).filter(username__icontains=q)
 results = []
 for user in usernames:
 name_json = {'value': user.username}

=== modified file 'news/feeds.py'
--- news/feeds.py	2018-04-08 14:40:17 +
+++ news/feeds.py	2018-09-15 07:44:50 +
@@ -21,25 +21,3 @@
 
 def item_pubdate(self, item):
 return item.publish
-
-# Currently not used / not checked for compatibility for django 1.8
-
-
-class NewsPostsByCategory(Feed):
-title = 'Widelands.org posts category feed'
-
-def get_object(self, bits):
-if len(bits) != 1:
-raise ObjectDoesNotExist
-return Category.objects.get(slug__exact=bits[0])
-
-def link(self, item):
-if not item:
-raise FeedDoesNotExist
-return item.get_absolute_url()
-
-def description(self, item):
-return 'Posts recently categorized as %s' % item.title
-
-def items(self, item):
-return item.post_set.published()[:10]

=== modified file 'news/urls.py'
--- news/urls.py	2016-12-13 18:28:51 +
+++ news/urls.py	2018-09-15 07:44:50 +
@@ -1,25 +1,25 @@
 from django.conf.urls import *
 from django.views.generic import ListView
 from news.views import NewsList, YearNews, MonthNews, NewsDetail, CategoryView
+from news.feeds import NewsPostsFeed
+
 
 urlpatterns = [
 url(r'^(?P[0-9]{4})/(?P[-\w]+)/(?P[0-9]+)/(?P[-\w]+)/$',
 NewsDetail.as_view(),
 name='news_detail'),
-
 url(r'^(?P\d{4})/(?P[-\w]+)/$',
 MonthNews.as_view(),
 name='news_archive_month'),
-
 url(r'^(?P\d{4})/$',
 YearNews.as_view(),
 name='news_archive_year'),
-
 url(r'^category/(?P[-\w]+)/',
 CategoryView.as_view(),
 name='category_posts'),
-
 url(r'^$',
 NewsList.as_view(template_name='news/post_list.html'),
 name='news_index'),
+# Feed
+url(r'^feed/$', NewsPostsFeed())
 ]

=== modified file 'pybb/feeds.py'
--- pybb/feeds.py	2018-04-08 14:40:17 +
+++ pybb/feeds.py	2018-09-15 07:44:50 +
@@ -3,6 +3,7 @@
 from django.core.exceptions import ObjectDoesNotExist
 from django.utils.feedgenerator import Atom1Feed
 from pybb.models import Post, Topic, Forum
+from django.conf import settings
 
 
 class PybbFeed(Feed):
@@ -60,11 +61,6 @