anitab-org / vms

THIS PROJECT IS ARCHIVED. Volunteer Management System.
GNU General Public License v2.0
1 stars 4 forks source link

Bug: Error when registering as admin #1121

Closed devkapilbansal closed 3 years ago

devkapilbansal commented 3 years ago

Description

When trying to register as an admin from the web interface it gives an error as:

ValueError at /en-us/registration/signup_administrator/
invalid literal for int() with base 10: 'Arāria'
devkapilbansal commented 3 years ago

Here is the full traceback:-

Environment:

Request Method: POST
Request URL: http://localhost:8000/en-us/registration/signup_administrator/

Django Version: 2.0
Python Version: 3.8.2
Installed Applications:
('authentication',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'administrator',
 'event',
 'home',
 'job',
 'organization',
 'registration',
 'shift',
 'volunteer',
 'cities_light',
 'pom',
 'rest_framework',
 'easy_pdf',
 'vms')
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/core/handlers/exception.py" in inner
  35.             response = get_response(request)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response
  128.                 response = self.process_exception_by_middleware(e, request)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response
  126.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapper
  62.             return bound_func(*args, **kwargs)

File "/home/kapil/Development/ANITA-B/vms/vms/registration/utils.py" in wrapper
  14.         return func(request, *args, **kwargs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/utils/decorators.py" in bound_func
  58.                 return func.__get__(self, type(self))(*args2, **kwargs2)

File "/home/kapil/Development/ANITA-B/vms/vms/registration/views.py" in dispatch
  49.         return super(AdministratorSignupView, self).dispatch(*args, **kwargs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)

File "/home/kapil/Development/ANITA-B/vms/vms/registration/views.py" in post
  105.                     admin_city = City.objects.get(pk=admin_city_name)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/manager.py" in manager_method
  82.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/query.py" in get
  394.         clone = self.filter(*args, **kwargs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/query.py" in filter
  836.         return self._filter_or_exclude(False, *args, **kwargs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/query.py" in _filter_or_exclude
  854.             clone.query.add_q(Q(*args, **kwargs))

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/sql/query.py" in add_q
  1252.         clause, _ = self._add_q(q_object, self.used_aliases)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/sql/query.py" in _add_q
  1273.                 child_clause, needed_inner = self.build_filter(

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/sql/query.py" in build_filter
  1214.         condition = self.build_lookup(lookups, col, value)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/sql/query.py" in build_lookup
  1084.         lookup = lookup_class(lhs, rhs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/lookups.py" in __init__
  18.         self.rhs = self.get_prep_lookup()

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/lookups.py" in get_prep_lookup
  68.             return self.lhs.output_field.get_prep_value(self.rhs)

File "/home/kapil/Development/ANITA-B/source_vms/lib/python3.8/site-packages/django/db/models/fields/__init__.py" in get_prep_value
  947.         return int(value)

Exception Type: ValueError at /en-us/registration/signup_administrator/
Exception Value: invalid literal for int() with base 10: 'Arāria'
devkapilbansal commented 3 years ago

@gaurivn @isabelcosta @vj-codes @atharwa-24 Please add this issue in bug and coding category to make others easier to find this.

devkapilbansal commented 3 years ago

@SanketDG can you look in this too. Also I don't know the expected time etc for this too. Probably it would be solved when we update.

codesankalp commented 3 years ago

@sanchibansal340 i want to work on this issue.

decon-harsh commented 3 years ago

I guess a PR has been raised and is in testing currently, Checkout Issue #1002. Do correct me if I am wrong.

codesankalp commented 3 years ago

Oh! my mistake, i see your comment when i made the pull request @decon-harsh. I will close this pull request soon.

devkapilbansal commented 3 years ago

Closing this as one is already there.