mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Merge branch 'master' into 'explicit>implicit'
# Conflicts: # apps/activity/views.py
This commit is contained in:
20
apps/activity/fixtures/initial.json
Normal file
20
apps/activity/fixtures/initial.json
Normal file
@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"model": "activity.activitytype",
|
||||
"pk": 1,
|
||||
"fields": {
|
||||
"name": "Pot",
|
||||
"can_invite": true,
|
||||
"guest_entry_fee": 500
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "activity.activitytype",
|
||||
"pk": 2,
|
||||
"fields": {
|
||||
"name": "Soir\u00e9e de club",
|
||||
"can_invite": false,
|
||||
"guest_entry_fee": 0
|
||||
}
|
||||
}
|
||||
]
|
@ -136,6 +136,8 @@ class Entry(models.Model):
|
||||
|
||||
class Meta:
|
||||
unique_together = (('activity', 'note', 'guest', ), )
|
||||
verbose_name = _("entry")
|
||||
verbose_name_plural = _("entries")
|
||||
|
||||
def save(self, *args,**kwargs):
|
||||
|
||||
|
@ -139,6 +139,7 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
|
||||
| Q(name__regex=pattern)
|
||||
| Q(normalized_name__regex=Alias.normalize(pattern)))) \
|
||||
.filter(PermissionBackend.filter_queryset(self.request.user, Alias, "view"))\
|
||||
.filter(note__noteuser__user__profile__registration_valid=True)\
|
||||
.distinct("username")[:20]
|
||||
for note in note_qs:
|
||||
note.type = "Adhérent"
|
||||
@ -153,5 +154,9 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
|
||||
context["title"] = _('Entry for activity "{}"').format(activity.name)
|
||||
context["noteuser_ctype"] = ContentType.objects.get_for_model(NoteUser).pk
|
||||
context["notespecial_ctype"] = ContentType.objects.get_for_model(NoteSpecial).pk
|
||||
|
||||
context["activities_open"] = Activity.objects.filter(open=True).filter(
|
||||
PermissionBackend.filter_queryset(self.request.user, Activity, "view")).filter(
|
||||
PermissionBackend.filter_queryset(self.request.user, Activity, "change")).all()
|
||||
|
||||
return context
|
||||
return context
|
Reference in New Issue
Block a user