-
Couldn't load subscription status.
- Fork 69
Do not allow login to inactive members -- solved #608
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
Conversation
A user whose account has been deativated and tries to navigate through any opttion will be redirected to a page showing all the timebanks to which they are a member and they can see the information to contact the admin. Issue #472
I put the messages directly in the html, now I changed all.
I ran the test and I saw that I destroyed this functionality, so I adapted what I did, now the tests work with the functionality that I added.
I tested both the new controller and the method in applicaction_controller. Issue #472
|
Hi @franpb14 👋🏼 and very welcome to TimeOverflow! 😄 As this is your 1st pull request here, let me add some general comments with tips, good practices, style ...
To move forward with this branch, IMO, we should just fix the problem described in #472. Let's start with small changes, step by step, it will be easier for all the team to give feedback, perform the code review, write all necessary tests... Thanks a lot for working on this and welcome to TimeOverflow Fran (and sorry for this long comment 😜 ) |
|
Thanks @markets for the review, I expected something like this, but I have some doubts:
|
No, no, tests and code should be in the same branch, but mixing small fixes with behavior changes (which can have more implications) it's a bad idea in general. Small branches are the best! In that case, if we want to avoid the login for non-active users, we can just (for example) redirect back with a flash message "You can't login to this organization", with no need to implement new pages and workflows.
Yep, this is right, probably it's just a matter of updating the branch. Best, |
|
Maybe I'm wrong but I think your proposed solution will create a critical bug. Without change the behaviour of login or without the new page, the users who were deactivated from the first organisation will not be able to login even if they are active in another organisation. |
|
Ah got it! you're right about that point 👍🏼 , now I understand better why you took this approach 😄 If @sseerrggii (the product owner) likes this solution, we can focus only on the "technical" aspects of this branch. For PRs that contains UI changes, it's a good idea to add some screenshots (or gif or video) in the description 👌🏼 |
I reseted my branch to the last commit (the one where the login behavior remained unchanged) and I applied the feedback received in the pull request. Resolves #472.
b60ae3c to
04e19d7
Compare
|
In the following video we can see the changes. Issue472.mp4I saw that travis failed but locally the tests run correctly and the log on Travis are different for each build. Why? Maybe it's a Travis fault? |
|
Hi @franpb14 that seems a flaky test, the PR build is passing. I tried to restart the build in Travis, but I got an error:
So, no worries about that point (will see in the next push), the build is also passing for me locally. Probably it's an order dependent test (which means we have an issue in our specs 😄 ). In I'd add some extra comments/feedback but now seems much better in general 👌🏼 Thanks for reviewing the comments. |
Identation, simplify code, i18n...
|
@markets Thank you very much for taking your time correcting it, I really appreciate it. I did a new push implementing feedback but the current_organization can't be nil easily because in "application_controller" the organisation is set for each action so that when the user enters, for example, /offers current_organisation would be set again. After talking to @sseerrggii we decided not to do that for this issue. |
6499ff3 to
fa5c885
Compare
|
@franpb14 @sseerrggii I pushed one commit with some minor tweaks (fa5c885). This is ready for testing from my side ✔️ Good job @franpb14 👍🏼 ℹ️ @sseerrggii we'll need to add 4 new keys in Locale |
In this branch I focused on solving the problem related to the issue #472. The solution that I suggest is the following: an user trying to access an organization in which he/she was deactivated will be redirected to a view that shows a warning message as well as a table with a list of the organzations (and all the information related to those organizations). The behavior of offers and inquiries is the same as for that of non-authenticated users, with the exception of those offers/inquiries coming from an organization in which they are active.
I additionnaly changed the "set_current_organization" so those users who had been deactivated in their first organization do not have to see the error message every time they log in.
Closes #472