OpenREM home.html fails with an error on fresh install due to anonymous user

Issue #195 resolved
David Platten created an issue

Cannot assign "<SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x7f9edc16c390>>": "UserProfile.user" must be a "User" instance.

Exception Value:
Cannot assign "<SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x7f9edc16c390>>": "UserProfile.user" must be a "User" instance.

I'll put an is_authenticated() check in views.py to check for this.

Comments (3)

  1. David Platten reporter
    • changed status to open

    My fix didn't fix this, it just prevented a server crash. Needs some additional work.

  2. David Platten reporter

    Display of modalities on home page now controlled by whether homedata contains any items of the corresponding modality. This bypasses the display settings stored in userprofile for the home page, but does mean that the home page works properly when no user is logged in. The filtered and detail modality pages still use the display settings stored in the userprofile to determine whether to show a particular modality. This fixes issue #195 and references issue #20.

    → <<cset 1dd24d1f34b5>>

  3. Log in to comment