Skip to content

fix: event backend and frontend creation #329

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

Merged
merged 3 commits into from
Feb 21, 2021

Conversation

imimouni
Copy link
Contributor

fix overrided merges-
location and vc separation
invited email

fix invited emails error when empty

fix vc_link references

fix models.py - make vc link nullable

@codecov-io
Copy link

codecov-io commented Feb 21, 2021

Codecov Report

Merging #329 (bfb164e) into develop (ab1d671) will decrease coverage by 0.03%.
The diff coverage is 94.44%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #329      +/-   ##
===========================================
- Coverage    98.05%   98.02%   -0.04%     
===========================================
  Files           73       73              
  Lines         3194     3195       +1     
===========================================
  Hits          3132     3132              
- Misses          62       63       +1     
Impacted Files Coverage Δ
app/internal/event.py 98.07% <93.33%> (-1.93%) ⬇️
app/database/models.py 96.82% <100.00%> (ø)
app/routers/event.py 96.55% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab1d671...bfb164e. Read the comment docs.

Copy link

@subscorp subscorp left a comment

Choose a reason for hiding this comment

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

Looks good! :)

logging.exception(
f"{invited_email} is not a valid email address",
)
continue

Choose a reason for hiding this comment

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

Probably shouldn't use continue or break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not my code.
I added the if not invited from form as this was producing an error for empty "invitees" field

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(so I am not sure what the effect will be, need to see who wrote this originally)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed this a bit. to guard clause as Yam asked + instead of continue used - try, except, else

<textarea id="say" name="description" placeholder="Description"></textarea>
<div class="form_row">
<label for="vc_link">VC link: </label>
<input type="text" id="vc_link" name="vc_link" placeholder="VC URL">

Choose a reason for hiding this comment

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

Use dashes in HTML ids: vc-link instead of vc_link.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is really problematic.
I've looked this through and though you are right this is a problem it exists all over the project in different tags and affects many many files and not related to the purpose of this PR (fixing create event).
Maybe it's necessary to open a new PR to fix this throughout the project . @yammesicka What do you think?

Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

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

Great work! Please just use guard instead of the long if/else in get_invited_emails

continue
invited_emails.append(invited_email)
if not invited_from_form:
invited_emails.append("")
Copy link
Member

Choose a reason for hiding this comment

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

return [""] instead, and unindent the else clause

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :) (I used try, except else inside the for loop)

@yammesicka yammesicka merged commit 46e0deb into PythonFreeCourse:develop Feb 21, 2021
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