Add verification page before unregistering from event from email #357#408
Add verification page before unregistering from event from email #357#408lioneltrebuchon wants to merge 15 commits intoamiv-eth:masterfrom
Conversation
|
Can you maybe provide a screenshot how this unregister page looks like? Does it work with different screen formats? |
|
And additionally, could you provide some reasoning about why we need this functionality in the api? |
| amivapi_storage | ||
|
|
||
| # Pycharm | ||
| .idea/* No newline at end of file |
There was a problem hiding this comment.
Nitpick: missing newline.
|
Implementation of two stage deletion as per |
bb7a65b to
188548b
Compare
NotSpecial
left a comment
There was a problem hiding this comment.
Thank you for your comments. I have some more suggestions.
On a different note: The changes to README.md seem quite unrelated to this PR. Maybe it would be better to open a separate PR for this, to only keep the relevant changes in this one?
README.md
Outdated
|
|
||
| # MongoDB Configuration | ||
| MONGO_HOST = 'mongodb' | ||
| MONGO_HOST = 'mongodb' # or 'localhost' if you run the API from Python |
There was a problem hiding this comment.
| MONGO_HOST = 'mongodb' # or 'localhost' if you run the API from Python | |
| MONGO_HOST = 'mongodb' # or 'localhost' if you run the database locally |
| 'description': 'Start time of the event itself. If you define ' | ||
| 'a start time, an end time is required, too.', | ||
| 'example': '2018-10-17T18:00:00Z', | ||
|
|
There was a problem hiding this comment.
Is it necessary to remove this newline? I think it helped the readability.
There was a problem hiding this comment.
Ah... for me it is the contrary, it is disturbing, as it should be part of the same json structure on the same level, I thought that it was clearer to keep it on one level.
There was a problem hiding this comment.
In this case I would add the line again, as this has nothing to do with the feature of this PR.
| 'description': 'End time of the event itself. If you define ' | ||
| 'an end time, a start time is required, too.', | ||
| 'example': '2018-10-17T22:00:00Z', | ||
|
|
There was a problem hiding this comment.
Is it necessary to remove this newline? I think it helped the readability.
| Is that ok? | ||
| {% else %} | ||
| You clicked on a opt-out link of the AMIV at ETHZ student organization. We cannot process your request, | ||
| because we either do <em>{not}</em> know the event you wish to unregister from, or your user name, or both. |
There was a problem hiding this comment.
Whats up with the curly braces around the not? Is this some special html syntax I don't know?
| REMOTE_MAILING_LIST_KEYFILE = None | ||
| REMOTE_MAILING_LIST_DIR = './' # Use home directory on remote by default | ||
| # Signups via email (@email_blueprint.route('/delete_signup/<token>') in email_links.py) | ||
| # DEFINITIVE_DELETE = '' |
There was a problem hiding this comment.
Why is this commented out? Is it needed?
amivapi/settings.py
Outdated
| API_MAIL = 'api@amiv.ethz.ch' | ||
| API_MAIL_SUBJECT = "[AMIV] {subject}" | ||
| SMTP_HOST = 'localhost' | ||
| SMTP_HOST = 'localhost' # None in case you want to accept that no mails get sent (local testing) |
There was a problem hiding this comment.
Thanks, I understand the comment now. But what exactly is the problem with leaving it on localhost for local testing? Is there some error?
There was a problem hiding this comment.
I removed it because I haven't been able to reproduce any error.
|
Note: I have updated this branch to the new master branch, make sure to pull before working on it again. |
When users are upgraded to members via LDAP, subscribe them to the newsletter. Newsletter settings of already imported members are not touched. Closes amiv-eth#400
- Add documentation for position field. - Add position field to post response. Fixes amiv-eth#405 Fixes amiv-eth#410
Even if FCFS in enabled, admins should be allowed to force a signup to be accepted. This worked as intended for PATCH requests already, and now also works for POST. Fixes amiv-eth#381
ad77da0 to
09ff765
Compare
09ff765 to
f10dc1d
Compare
d120e26 to
8dbe85f
Compare
|
@temparus I believe the base is working. Haven't changed much. |
NotSpecial
left a comment
There was a problem hiding this comment.
Thank you for your continued work!
Most of all, thank you for adding tests. However, I am currently having a hard time to understand what is being tested, and what the expected functionality is, so I can't really judge whether the tests are sufficient or not.
Please try to:
- break the tests up a little,
- explain the expected behavior more.
This would be greatly appreciated!
I have a few nitpicks here and there as well, please try to address them, too.
| # Create a network so that the api service can later be connected to the db | ||
| docker network create --driver overlay backend | ||
|
|
||
| # |
There was a problem hiding this comment.
This line seems to serve no purpose?
| amiveth/amivapi amivapi cron --continuous | ||
|
|
||
| # To attach your command line to the docker instance, use | ||
| docker attach amivapi... # Use tab completion to find the name of the service |
There was a problem hiding this comment.
Thinking about it: This is not at all how one should use a docker service, and not really required for the amivapi, so I don't think we should recommend this here.
| return "Unknown token" | ||
|
|
||
| # Verify if user confirmed | ||
| # definitive = request.args.get('DEFINITIVE_DELETE') |
There was a problem hiding this comment.
Does this comment serve any purpose?
| 'description': 'Start time of the event itself. If you define ' | ||
| 'a start time, an end time is required, too.', | ||
| 'example': '2018-10-17T18:00:00Z', | ||
|
|
There was a problem hiding this comment.
In this case I would add the line again, as this has nothing to do with the feature of this PR.
| self.api.get('/delete_signup/%s' % token, status_code=302) | ||
| self.api.get('/eventsignups/%s' % signup['_id'], status_code=200) | ||
| self.api.get('/delete_signup/%s' % token, status_code=200) | ||
| self.api.post('/delete_confirmed/%s' % token, status_code=302) |
There was a problem hiding this comment.
Thank you for adding tests ... unfortunately I do not understand at all what is going on here, and why e.g. in this last line a status code 302 is expected.
As the flow is now considerably more complicated, please either:
- Split this test up into multiple tests that are clear about which part is being tested.
- If it is impossible to split them up, please modify the docstring to explain the expected behavior.
The more I look at it, the more I think our original tests here are already confusing. I would greatly appreciate it if you could try to split the tests up a bit more to make them more understandable.
No description provided.