~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to online_users_middleware.py

  • Committer: franku
  • Date: 2018-05-07 07:03:26 UTC
  • mfrom: (493.1.3 online_users)
  • Revision ID: somal@arcor.de-20180507070326-ycoxgliv4vtuzyq7
fixed bug 1769235; using a databse cache to get the Online users box work correct

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
@receiver(user_logged_out)
17
17
def logout(sender, **kwargs):
18
 
    cache.delete('online-%s' % kwargs['user'].id)
 
18
    try:
 
19
        cache.delete('online-%s' % kwargs['user'].id)
 
20
    except AttributeError:
 
21
        pass
19
22
 
20
23
 
21
24
class OnlineNowMiddleware(MiddlewareMixin):