Skip to content

Commit

Permalink
Some additional minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sthapa committed Dec 12, 2024
1 parent 22a3173 commit 2463b51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion froide/account/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class NewUserBaseForm(forms.Form):
def __init__(self, *args, **kwargs) -> None:
address_required = kwargs.pop("address_required", False)
super().__init__(*args, **kwargs)
self.fields["address"].required = address_required
if ALLOW_PSEUDONYM and not address_required:
self.fields["last_name"].help_text = format_html(
_(
Expand Down
4 changes: 4 additions & 0 deletions froide/document/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def filter_foirequest(self, qs, name, value):


def get_portal_queryset(request):
from django.contrib.auth.models import AnonymousUser
# is_crew is not an attribute of Anonymous users
if isinstance(request.user, AnonymousUser):
return DocumentPortal.objects.filter(public=True)
if not request.user.is_crew:
return DocumentPortal.objects.filter(public=True)
return DocumentPortal.objects.all()
Expand Down

0 comments on commit 2463b51

Please sign in to comment.