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

Admin versus Root Path Functionality #41

Open
Parthian opened this issue Aug 3, 2023 · 4 comments
Open

Admin versus Root Path Functionality #41

Parthian opened this issue Aug 3, 2023 · 4 comments

Comments

@Parthian
Copy link

Parthian commented Aug 3, 2023

Take a look at your my-shop
Attempt to Change Password from the Dashboard. (From Icon on right).
http://my-shop.django-erp-framework.com/accounts/login/?next=/password_change/ - Fails to Django Debug page with a 404

http://my-shop.django-erp-framework.com/**admin**/accounts/login/?next=/password_change/ - addition of /admin/ for the win.

Refering to my own project now.
Essentially, on all ERP projects you have to be in the /admin/ path for typical User/Group functions to work.
It is possible to see the list of Users or Groups but a click to a path like this mywebsite.com/auth/group/2/change/ results in a KeyError

KeyError at /en-gb/auth/group/2/change/
'appname.randommodelname' - which appears to be nothing to do with Groups
Again adding in domain.com/admin/... fixes the issue.

Going on great otherwise.

@RamezIssac
Copy link
Owner

Hello @Parthian
Happy to see you working on the ERP and the package again... would like to contact you, do you mind sending me an email ? my email is on my profile.

For the user thing, i disagree that ERP need to be in the /admin/ sub url. I saw teh issue and i believe this a jazzmin issue and can be adjust from the jazzmin and/or django settings.

Can you send me a full stack trace of the Key error ? Also are you sure you're logged in ?!

Glad to hear it's going on great otherwise.

@Parthian
Copy link
Author

Parthian commented Aug 8, 2023

Hi Ramez,
Possibly related to this domain/admin.
I can't change Group or User permissions.
In normal django there is the list of Available permissions on the left. With the ability to move them to Chosen permissions on right. ERP has added the checkboxes and I've turned off Jazzmin in case that was a jazzmin feature.
But ticking the boxes doesn't seem to do anything. Hit save and they are still all unchecked.

Looking at the POST request I can't see anything being sent to the database.

On my User permissions there is a subset of 3 of my models with all 4 permissions - 12 in total sitting in either the Available or Chosen widget. These can be added and removed. But not via the checkboxes.
These 3 models were added fairly recently so I've no idea why these are treated differently from the other models in several apps.

@Parthian
Copy link
Author

Parthian commented Aug 10, 2023

I've got a workaround for the the limited Available Permissions.
In settings comment out tabular_permissions. Restart and all my models suddenly appear and can be copied over to Chosen Permissions.

The only similar issue, that I've found, with a subset of models appearing in Available is this - https://stackoverflow.com/questions/62871961/group-and-permissions-assignment-missing-when-using-custom-user-model
May be a clue.

@Parthian
Copy link
Author

Any progress with this one?
In summary.
Login here - https://my-shop.django-erp-framework.com/admin/login/
But logout from the home page.
https://my-shop.django-erp-framework.com/logout/
Results in

TemplateDoesNotExist at /logout/

admin/logout.html
Request Method: | GET -- | -- http://my-shop.django-erp-framework.com/logout/ 4.2.1 TemplateDoesNotExist admin/logout.html /var/www/.envs/my_shop/lib/python3.10/site-packages/django/template/loader.py, line 47, in select_template django.contrib.admin.sites.logout /var/www/.envs/my_shop/bin/python3 3.10.12 ['/var/www/my-shop', '/var/www/.envs/my_shop/bin', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/var/www/.envs/my_shop/lib/python3.10/site-packages', '/var/www/.envs/my_shop/src/django-slick-reporting', '/var/www/.envs/my_shop/src/django-erp-framework']

I imagine everyone using DjangoERP must have the same issue. But no one reports it. So does everyone find a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants