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

Fix error in /tip for non-logged in user #7938

Merged
merged 1 commit into from
Dec 8, 2020

Conversation

sebastiantf
Copy link
Contributor

Description

Follow-up for #7830

Fixes showing this error for non-logged-in user:

'AnonymousUser' object has no attribute 'profile'

Refers/Fixes

#7830 (comment)

Screenshot

This user is not logged in:

fix:recent-tips

@sebastiantf sebastiantf changed the title fix error for non-logged in user Fix error in /tip for non-logged in user Nov 25, 2020
@thelostone-mc
Copy link
Member

@sebastiantf a neater way to go about this would be to add the @login_required decorator in views.py file

@sebastiantf
Copy link
Contributor Author

sebastiantf commented Nov 26, 2020

@thelostone-mc When @login_required is used, it automatically redirects to Github login and then to Townsquare without being able to see the /tip page. Is that fine?

Also, @login_required was not used for the /tip page in the first place

Should I revert this commit and use the decorator?

Copy link
Contributor

@amustapha amustapha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a syntatic sugar enhancement. could do good.

@thelostone-mc
Copy link
Member

Should I revert this commit and use the decorator?

@sebastiantf yup would be cleaner ! plus there is no reason for folks to use /tiop without being logged in

@sebastiantf
Copy link
Contributor Author

Should I revert this commit and use the decorator?

@sebastiantf yup would be cleaner ! plus there is no reason for folks to use /tiop without being logged in

@thelostone-mc Done 👍

Copy link
Member

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :D

@thelostone-mc thelostone-mc merged commit 37efe80 into gitcoinco:master Dec 8, 2020
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

Successfully merging this pull request may close these issues.

4 participants