NIT-DGPortal / StudentPortal

A customised study portal for NIT Durgapur.
https://nitdgpsp.herokuapp.com
MIT License
17 stars 29 forks source link

Typo in /pro1/users/models.py #8

Open gopavasanth opened 5 years ago

gopavasanth commented 5 years ago

In Python version 3.5.2

Traceback (most recent call last): File "manage.py", line 15, in execute_from_command_line(sys.argv) File "/home/gopavasanth/.local/lib/python3.5/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute() File "/home/gopavasanth/.local/lib/python3.5/site-packages/django/core/management/init.py", line 357, in execute django.setup() File "/home/gopavasanth/.local/lib/python3.5/site-packages/django/init.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/home/gopavasanth/.local/lib/python3.5/site-packages/django/apps/registry.py", line 112, in populate app_config.import_models() File "/home/gopavasanth/.local/lib/python3.5/site-packages/django/apps/config.py", line 198, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 661, in exec_module File "", line 767, in get_code File "", line 727, in source_to_code File "", line 222, in _call_with_frames_removed File "/home/gopavasanth/Desktop/StudentPortal/pro1/users/models.py", line 11 return f'{self.user.username} Profile'

Hack: Change "return f'{self.user.username}" Profile' to "return '{self.user.username} Profile'"

This Solved my Issue !!

monsij commented 5 years ago

assigned @arpit3018

nguptaa183 commented 5 years ago

Please assign me this issue

monsij commented 5 years ago

Sorry @nguptaa , Let @arpit3018 wind up his work with this first

arpit3018 commented 5 years ago

Hey @monsij . do we need that usernames in the admin panel like this? Look the below the image

arpit3018 commented 5 years ago

screenshot from 2018-12-06 21-11-38

monsij commented 5 years ago

Need means?...Do you want to alter the formatting? @arpit3018

arpit3018 commented 5 years ago

I mean to save that earlier it is showing some meaning less info on f'{self.user.username} Profile' but after change it to self.user.username. It now shows the name of the user. So is it right or should I change something? @monsij

monsij commented 5 years ago

Please put the screenshots in either case 🍶

arpit3018 commented 5 years ago

screenshot from 2018-12-06 21-52-37 screenshot from 2018-12-06 21-52-48

monsij commented 5 years ago

This is what is there when f'{self.user.username} Profile' is used : admin Was that same to what you got ?

arpit3018 commented 5 years ago

Okay got it. Look the below one. @monsij screenshot from 2018-12-06 21-59-30

monsij commented 5 years ago

Yup. It's working fine right with the existing code?

arpit3018 commented 5 years ago

Nope. I Changed it to self.user.username + ' Profile'

monsij commented 5 years ago

But it's working fine with f'{self.user.username} Profile' for me

monsij commented 5 years ago

Marking this issue for future.Will continue on it later . Thanks @arpit3018

arpit3018 commented 5 years ago

This is not working for me. It is showing the error which was mention above by @gopavasanth. Have a look at it @monsij

monsij commented 5 years ago

Unless it shows error during deployment..it cant be changed

arpit3018 commented 5 years ago

No issues. Thanks