-
Notifications
You must be signed in to change notification settings - Fork 52
feat: change owner of event #268
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
feat: change owner of event #268
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #268 +/- ##
========================================
Coverage 99.04% 99.05%
========================================
Files 52 52
Lines 2409 2425 +16
========================================
+ Hits 2386 2402 +16
Misses 23 23
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I've added few insights :)
app/routers/event.py
Outdated
async def changeowner(request: Request, event_id: int, | ||
db: Session = Depends(get_db)): | ||
data = await request.form() | ||
if 'username' in data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer if 'username' not in form: return [...]
and the rest of the code unindented
app/routers/event.py
Outdated
@router.post("/{event_id}") | ||
async def changeowner(request: Request, event_id: int, | ||
db: Session = Depends(get_db)): | ||
data = await request.form() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer a better name, form
for example
app/templates/base.html
Outdated
</li> | ||
<li class="nav-item"> | ||
<!-- new button for the agenda page. should be available after login | ||
<div class="collapse navbar-collapse" id="navbarText"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return this to be indentation of 2 spaces
app/templates/profile.html
Outdated
@@ -1,338 +1,316 @@ | |||
{% extends "base.html" %} {% include "event/partials/text_editor_partial_head.html" %} {% block content %} | |||
|
|||
<div class="container mt-4"> | |||
<div class="container mt-4"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return to 2 spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Just few additional small fixes
app/routers/event.py
Outdated
@@ -97,6 +97,31 @@ async def eventview(request: Request, event_id: int, | |||
"messages": messages}) | |||
|
|||
|
|||
@router.post("/{event_id}/owner_changed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just /owner
is good enough :)
app/routers/event.py
Outdated
@@ -97,6 +97,31 @@ async def eventview(request: Request, event_id: int, | |||
"messages": messages}) | |||
|
|||
|
|||
@router.post("/{event_id}/owner_changed") | |||
async def changeowner(request: Request, event_id: int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change_owner
</div> | ||
<div class="event_info_row"> | ||
<span class="icon">ICON</span> | ||
<time datetime="{{ event.start }}">{{ event.start.strftime(start_format )}}</time> | ||
- | ||
<time datetime="{{ event.start }}">{{ event.start.strftime(start_format )}}</time> - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the spacing here
change owner of an event