Add markdown exports and tighten tag visibility
This commit is contained in:
@@ -189,6 +189,13 @@ class CollectionForm(forms.ModelForm):
|
||||
|
||||
|
||||
class ApiKeyForm(forms.ModelForm):
|
||||
def __init__(self, *args, user=None, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
if user and user.is_authenticated:
|
||||
self.fields['tags'].queryset = Tag.objects.filter(items__owner=user).distinct().order_by('name')
|
||||
else:
|
||||
self.fields['tags'].queryset = Tag.objects.none()
|
||||
|
||||
class Meta:
|
||||
model = ApiKey
|
||||
fields = ['name', 'tags']
|
||||
|
||||
Reference in New Issue
Block a user