~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wlprofile/views.py

  • Committer: franku
  • Date: 2018-09-14 06:42:53 UTC
  • mto: This revision was merged to the branch mainline in revision 500.
  • Revision ID: somal@arcor.de-20180914064253-2kbdttkbhi8al3l1
delete also the playtime availabilities

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    # we get the User object.
43
43
    logout(request)
44
44
 
 
45
    # Clean possible Playtime availabilities
 
46
    from wlscheduling.models import Availabilities
 
47
    try:
 
48
        events = Availabilities.objects.filter(user=user)
 
49
        for event in events:
 
50
            event.delete()
 
51
    except:
 
52
        pass
 
53
            
45
54
    # Clean the Online gaming password
46
55
    from wlggz.models import GGZAuth
47
56
    try:
89
98
    user.is_superuser = False
90
99
    user.email = settings.DELETED_MAIL_ADDRESS
91
100
    user.save()
 
101
 
92
102
    return redirect('mainpage')
93
103
 
94
104