AERPAW-Platform-Control / aerpaw-portal

AERPAW Portal v2
0 stars 2 forks source link

Profile - Not Found and user's able to request Experimenter role without pre-reqs #47

Closed mjstealey closed 1 year ago

mjstealey commented 1 year ago

We are observing two issues below with the portal. This needs your assistance in brainstorming and troubleshooting. Thanks a lot for availing your time.

  1. Most new users are getting the error below when they click "Profile". It seems to fix itself randomly (saying this because we are not able to figure a pattern) image.png

    • [x] Add logic specific to new users and the profile page view
      @csrf_exempt
      @login_required
      def profile(request):
      ....
      # check for user_id in request object - force expiry if not found
      if not request.user.id:
      return redirect('session_expired')
      user = get_object_or_404(AerpawUser, pk=request.user.id)
      # if user was just created force a re-login
      if not user.last_login:
      return redirect('session_expired')
  2. Requests come with "None" for the mandatory fields Employer and Position. We exchanged emails a bit about this yesterday. Today Rudra and I tested and saw that the users are indeed typing in things in those fields, but the backend is not capturing them.

    • [x] Bundle all user/profile related fields under one update profile button to reduce confusion Screenshot 2023-03-01 at 11 51 12 AM