mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
hot fix: Updated variable names & comments (#461)
- Fixed a wrong condition on the users subscribing history `read` permission. - The comments are clearer and mentions how to specify clubs by their id.
This commit is contained in:
@ -415,11 +415,14 @@ class User(AbstractBaseUser):
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def can_read_subscription(self):
|
||||
def can_read_subscription_history(self):
|
||||
if self.is_root or self.is_board_member:
|
||||
return True
|
||||
|
||||
from club.models import Club
|
||||
|
||||
for club in Club.objects.filter(
|
||||
id__in=settings.SITH_CAN_READ_SUBSCRIPTIONS
|
||||
id__in=settings.SITH_CAN_READ_SUBSCRIPTION_HISTORY
|
||||
).all():
|
||||
if club.has_rights_in_club(self):
|
||||
return True
|
||||
@ -703,7 +706,7 @@ class AnonymousUser(AuthAnonymousUser):
|
||||
return False
|
||||
|
||||
@property
|
||||
def can_read_subscription(self):
|
||||
def can_read_subscription_history(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
|
@ -145,7 +145,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if profile.was_subscribed and (user == profile or user.is_root or user.is_board_member or user.can_read_subscription)%}
|
||||
{% if profile.was_subscribed and (user == profile or user.can_read_subscription_history)%}
|
||||
<div id="drop_subscriptions">
|
||||
<h5>{% trans %}Subscription history{% endtrans %}</h5>
|
||||
<table>
|
||||
|
Reference in New Issue
Block a user