Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gopavasanth opened this issue Dec 4, 2018 · 18 comments
Open

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

gopavasanth opened this issue Dec 4, 2018 · 18 comments
Labels
bug Something isn't working Future

Comments

@gopavasanth
Copy link
Contributor

gopavasanth commented Dec 4, 2018

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 monsij changed the title Typo in StudentPortal/pro1/users/models.py Typo in /pro1/users/models.py Dec 4, 2018
@monsij monsij added the bug Something isn't working label Dec 4, 2018
@monsij
Copy link
Member

monsij commented Dec 4, 2018

assigned @arpit3018

@monsij monsij added the assigned label Dec 5, 2018
@nguptaa183
Copy link
Contributor

Please assign me this issue

@monsij
Copy link
Member

monsij commented Dec 6, 2018

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

@arpit3018
Copy link
Contributor

arpit3018 commented Dec 6, 2018

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

@arpit3018
Copy link
Contributor

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

@monsij
Copy link
Member

monsij commented Dec 6, 2018

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

@arpit3018
Copy link
Contributor

arpit3018 commented Dec 6, 2018

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
Copy link
Member

monsij commented Dec 6, 2018

Please put the screenshots in either case 🍶

@arpit3018
Copy link
Contributor

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

@monsij
Copy link
Member

monsij commented Dec 6, 2018

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

@arpit3018
Copy link
Contributor

arpit3018 commented Dec 6, 2018

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

@monsij
Copy link
Member

monsij commented Dec 6, 2018

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

@arpit3018
Copy link
Contributor

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

@monsij
Copy link
Member

monsij commented Dec 6, 2018

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

@monsij
Copy link
Member

monsij commented Dec 6, 2018

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

@arpit3018
Copy link
Contributor

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

@monsij monsij added Future and removed assigned labels Dec 6, 2018
@monsij
Copy link
Member

monsij commented Dec 6, 2018

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

@arpit3018
Copy link
Contributor

No issues. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Future
Projects
None yet
Development

No branches or pull requests

4 participants