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

Profile Error - partials/account/tabs/my_bills.html doesn't exist #964

Closed
aniket-banyal opened this issue Aug 5, 2021 · 6 comments · Fixed by #966
Closed

Profile Error - partials/account/tabs/my_bills.html doesn't exist #964

aniket-banyal opened this issue Aug 5, 2021 · 6 comments · Fixed by #966

Comments

@aniket-banyal
Copy link
Contributor

Internal Server Error: /profile/ani

Error - django.template.exceptions.TemplateDoesNotExist: partials/account/tabs/my_bills.html

I checked and found that my_bills.html was deleted in b600ead

@brylie
Copy link
Member

brylie commented Aug 5, 2021

Good catch. We removed (most) functionality related to bills/legislation but seem to have overlooked this template. Please consider removing the reference to the template and any similar code you may find.

@aniket-banyal
Copy link
Contributor Author

You may assign it to me

@aniket-banyal
Copy link
Contributor Author

<script type="text/javascript" src="{% static "js/account.js" %}"></script>

I made this change - src="{% static 'js/account.js' %}"
And removed references to mybills

Now on opening profile, it just continues to load indefinitely (Might be related to #914)

Also take a look at the error in console -

Screenshot (373)

I visited the url shown in the console and got this error -

Internal Server Error: /api/account_profile/ani/
Traceback (most recent call last):
File "C:\Users\HP\Desktop\OpenCiviWiki\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\HP\Desktop\OpenCiviWiki\env\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\HP\Desktop\OpenCiviWiki\project\api\read.py", line 51, in get_profile
result = Account.objects.summarize(a)
File "C:\Users\HP\Desktop\OpenCiviWiki\project\api\models\account.py", line 40, in summarize
"history": [
File "C:\Users\HP\Desktop\OpenCiviWiki\project\api\models\account.py", line 41, in
Civi.objects.serialize(c)
File "C:\Users\HP\Desktop\OpenCiviWiki\project\api\models\civi.py", line 46, in serialize
"hashtags": [hashtag.title for hashtag in civi.hashtags.all()],
AttributeError: 'Civi' object has no attribute 'hashtags'

@aniket-banyal
Copy link
Contributor Author

Do I need to change the files in project\staticfiles folder or would they be automatically changed?

@brylie
Copy link
Member

brylie commented Aug 5, 2021

Well, we're in the process of replacing the JavaScript UI with static templates that get rendered by Django. So the ideal outcome here would be to replace this template with a Django-only template and delete the deprecated JS for this particular view. You can feel free to take creative liberty with the rendered output but it might be worth using the existing styles since they are fairly nice.

@brylie
Copy link
Member

brylie commented Aug 5, 2021

For the specific error, it looks like we changed the hashtags field to just tags and neglected to update the related code.

tags = TaggableManager()

It might be worth searching the project for uses of the hashtags field and replacing it with tags to see how far we get.

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

Successfully merging a pull request may close this issue.

2 participants