-
Notifications
You must be signed in to change notification settings - Fork 8
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
Show private activities too on calender when logged in #333
base: master
Are you sure you want to change the base?
Show private activities too on calender when logged in #333
Conversation
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.
I agree with the changes, but tests should be added.
Each TestCase
class has a client
attribute. You can set a user there through self.client.force_login(<user>)
. If you're working with raw requests, you can set the Request.user
attribute directly as well.
user_interaction/views.py
Outdated
Activity.objects.filter(published_date__lte=timezone.now()) | ||
.filter( | ||
Q(type=ActivityType.ACTIVITY_PUBLIC) | ||
| (Q(type=ActivityType.ACTIVITY_MEETING) & Q(organisers__members=self.request.member)) |
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.
I'm not sure what will happen if self.request.member = None
. Might be useful to check that condition first just to be safe. Something along the lines of (pseudocode):
q = Q(PUBLIC-Q)
if member is not None:
q |= Q(MEETINGS-Q)
for activity in Activity.objects.filter(q):
...
How do you log out an user, Edit: |
Add a flake8 config file with a max line length so that stops complaining Add some pytest plugings so I can run the tests from VS code Some formatting changes Add if statement to check if member is none Try to change the input of the private meetings of the calendar (not finished yet) Add a button to subscribe to private meetings of the calendar (not finished yet) todo: tests
6e639a3
to
054284c
Compare
b9fd856
to
1aae130
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #333 +/- ##
==========================================
- Coverage 95.84% 95.81% -0.04%
==========================================
Files 161 161
Lines 7118 7137 +19
Branches 1166 1169 +3
==========================================
+ Hits 6822 6838 +16
- Misses 194 196 +2
- Partials 102 103 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Otherwise they are so hidden that it is useless. I am still working on the pr, but what do y’all think?
(I couldn’t quickly find where to set the user in the test)
Todo: