Open gopavasanth opened 5 years ago
assigned @arpit3018
Please assign me this issue
Sorry @nguptaa , Let @arpit3018 wind up his work with this first
Hey @monsij . do we need that usernames in the admin panel like this? Look the below the image
Need means?...Do you want to alter the formatting? @arpit3018
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
Please put the screenshots in either case 🍶
This is what is there when f'{self.user.username} Profile'
is used :
Was that same to what you got ?
Okay got it. Look the below one. @monsij
Yup. It's working fine right with the existing code?
Nope. I Changed it to self.user.username + ' Profile'
But it's working fine with f'{self.user.username} Profile'
for me
Marking this issue for future.Will continue on it later . Thanks @arpit3018
This is not working for me. It is showing the error which was mention above by @gopavasanth. Have a look at it @monsij
Unless it shows error during deployment..it cant be changed
No issues. Thanks
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 !!