Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Upgrade Django to 3.0.9(latest) #1056

Open
4 tasks
Kajol-Kumari opened this issue Aug 31, 2020 · 20 comments
Open
4 tasks

Upgrade Django to 3.0.9(latest) #1056

Kajol-Kumari opened this issue Aug 31, 2020 · 20 comments
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack

Comments

@Kajol-Kumari
Copy link

Description

Currently we are using Django 2.0 which is quite outdated

Acceptance Criteria

Update

  • Upgrade the Django version to latest stable version i.e 3.0.9
  • Make the required changes in the codebase to make sure it doesn't break anything.

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Estimation

8-10 hours

@Kajol-Kumari Kajol-Kumari added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack labels Aug 31, 2020
@shreyagupta30
Copy link

Hi @Kajol-Kumari, can I work on this as a part of OSH?

@Kajol-Kumari
Copy link
Author

Hey @shreyagupta30 please go ahead with this issue.

@Kajol-Kumari
Copy link
Author

Hey @shreyagupta30 can you please provide the update on your work progress for this issue.

@adwait2001
Copy link

can you assign me this task

@shreyagupta30
Copy link

Hey @shreyagupta30 can you please provide the update on your work progress for this issue.

I am working on it, will be able to land a PR in a day or two.

@sujal111
Copy link

sujal111 commented Sep 8, 2020

I am willing to work and solve this issue. Please assign me the same

@vj-codes
Copy link
Member

How's the PR going? @shreyagupta30

@devkapilbansal
Copy link
Member

@vj-codes can you assign me this issue?

@Kajol-Kumari
Copy link
Author

Unassigning @shreyagupta30 as I haven't heard back for quite a while. @KapilBansal320 I am assigning it to you as I can see you don't have any issue on you plate as of now and @sujal111 please complete your assigned issue.

@devkapilbansal
Copy link
Member

Thanks, @Kajol-Kumari I will make a pull request soon.

@devkapilbansal
Copy link
Member

Hi, @Kajol-Kumari After setting up, I try to register as an Admin but got this error:
errorvms

Can you please tell me where I got wrong

Here is the full traceback that I got:

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: 'New Delhi'

@SanketDG
Copy link

From what I grasp, whatever you enter as "New Delhi" in the form is actually expecting a integer.

@devkapilbansal
Copy link
Member

@SanketDG but form provides me with a drop down menu only.

@devkapilbansal
Copy link
Member

I will open an issue for this too soon

@Kajol-Kumari
Copy link
Author

@KapilBansal320 can please verify once if it's working for other cities listed in the dropdown?

@devkapilbansal
Copy link
Member

devkapilbansal commented Sep 17, 2020

@Kajol-Kumari issue arises for other cities as well.

Opened an issue for this at #1121

@devkapilbansal
Copy link
Member

devkapilbansal commented Sep 23, 2020

@Kajol-Kumari @vj-codes can you provide me with a way to solve this. As libraries like django-cities-light and django-easy-pdf don't support Django 3 yet.

Or should I search for their alternatives now.

@SanketDG
Copy link

Yes, django-cities-light is in sad state of affairs, please try to look for alternatives.

@devkapilbansal
Copy link
Member

At first, I am testing this repositories to find for bugs and to understand it better. Please look at issues opened by me too.

@devkapilbansal
Copy link
Member

Unassigning at this moment. Will look into this if I found better alternatives.

@devkapilbansal devkapilbansal removed their assignment Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack
Projects
None yet
Development

No branches or pull requests

7 participants