We are observing two issues below with the portal. This needs your assistance in brainstorming and troubleshooting. Thanks a lot for availing your time.
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')
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
[x] Add a customizable template tag named profile_check() to ensure validity of the employer and position fields prior to enabling the request role button
@register.filter
def profile_check(user_profile):
try:
employer = user_profile.get('employer', None)
position = user_profile.get('position', None)
if not employer or employer.casefold() == 'none':
return False
if not position or position.casefold() == 'none':
return False
return True
except Exception as exc:
print(exc)
return False
We are observing two issues below with the portal. This needs your assistance in brainstorming and troubleshooting. Thanks a lot for availing your time.
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
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.
profile_check()
to ensure validity of the employer and position fields prior to enabling the request role button