-
Notifications
You must be signed in to change notification settings - Fork 4
Migrated Events app to CBV #364
Migrated Events app to CBV #364
Conversation
@amruthasangeeth Travis is throwing errors, can you please fix them?
This failure is present in your other pull requests as well, @smarshy found out that the value should not be same to pass this assertion. Let us know if you are not able to resolve the errors. cc @nida @nidhimj22. |
86f63fe
to
0b14da1
Compare
@smarshy Can you spot the error it is showing in test? I am not able to find it. |
@amruthasangeeth On editing event, it isn't getting saved. Also, you are having same value retention problem as in the jobs pr. What that means is that if the form gets refreshed / reloaded for some reason ( say invalid values entered) the values that the user has already entered shouldn't vanish. |
), | ||
], | ||
blank=True, | ||
null=True, |
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.
@amruthasangeeth Are there any changes in this model?
I can spot only the autoincrement one
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.
@smarshy Only the id is the new one.
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.
@amruthasangeeth Complete file is coming as diff, it is really difficult to review. Can you please undo the unnecessary changes (cleanups, spacing)?
@amruthasangeeth Please fix the errors in this and all the consecutive pull requests. |
@amruthasangeeth This has less errors - both are related to edit event. Please try testing this locally. Edit an event with valid details and check if it gets saved. Also, the second error is due to this Here, since the end date is not wrong, it isn't expected to be erased. Since the same error did not take place for create event, I think this too is related to edit event |
d7556ca
to
b1d01d0
Compare
Coverage increased (+0.4%) to 84.3% when pulling b1d01d01d8dfc280b947f03923b251df8dccfc7b on amruthasangeeth:ShiftEventsToCBV into 91677ce on systers:develop. |
@tapasweni-pathak All the test cases here are passed now :) |
|
||
class EventDateForm(forms.Form): | ||
start_date = forms.DateField(required=True) | ||
end_date = forms.DateField(required=True) |
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.
@amruthasangeeth What has been changed in this file? Nothing, right? Did you run pep8?
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.
@tapasweni-pathak No changes are made in this file.
@amruthasangeeth Great. :) If you see you will find that complete files are coming in the diff, it becomes very difficult to review such a diff. Can you please undo the unnecessary changes and only have the useful ones in this pull request? You can submit a new pull request for the cleanups, spacing issues e.t.c. |
@@ -4,7 +4,7 @@ | |||
|
|||
{% block setting_content %} | |||
<div class="spacer"></div> | |||
<form class="form-horizontal" action="{% url 'event:delete' event_id %}" method="post"> | |||
<form class="form-horizontal" action="" method="post"> |
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.
@amruthasangeeth Where are we redirecting to delete?
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.
@tapasweni-pathak DeleteView works just like that.
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.
@amruthasangeeth Then do we need this form tag ?
Migrated function based views in Events app to class based views
b1d01d0
to
f4bf510
Compare
template_name = "event/list.html" | ||
|
||
def get_queryset(self): | ||
events = Event.objects.all().order_by('name') |
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.
@tapasweni-pathak Updated the PR by making the list in sorted order.
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.
@amruthasangeeth Cool.
@tapasweni-pathak There are tests for this, they are commented out as the current vms does not redirect to no admin pages uniformly. I have added a test for this - here |
@smarshy Okay. Do we have these tests for the cases when it is being redirected to no admin page or all are commented? |
Migrated function based views in Events app to class based views. The following are the views used:
ListView - To list the Events
UpdateView - To edit the Event details
DeleteView - To delete a Event object
#288.