Skip to content

Commit

Permalink
Block organizations' editing if it's from NGO Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Oct 2, 2024
1 parent 793cb4d commit c882a6d
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 164 deletions.
3 changes: 3 additions & 0 deletions backend/donations/views/my_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,13 @@ def get(self, request, *args, **kwargs):
if not user.is_authenticated or not user.ngo:
return redirect(reverse("contul-meu"))

is_ngohub_ngo = user.ngo.ngohub_org_id is not None

context = {
"title": "Date organizație",
"user": user,
"ngo": user.ngo if user.ngo else None,
"has_ngohub": is_ngohub_ngo,
"counties": settings.FORM_COUNTIES_NATIONAL,
}

Expand Down
26 changes: 17 additions & 9 deletions backend/templates/v1/components/county.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<select class="form-control" id="{{ identifier }}" name="{{ identifier }}" required x-moz-errormessage="Județul este obligatoriu" title="Județul este obligatoriu">
<option value="" class="select-placeholder">Județul</option>
<optgroup label="București">
{% for number in range(1, 7) %}
<option value="{{ number }}" {{ "selected" if number|string == county }}>Sector {{ number }}</option>
{% endfor %}
</optgroup>
{% for county_name in counties %}
<option value="{{ county_name }}" {{ "selected" if county_name == county }} >{{ county_name }}</option>
<select
class="form-control"
id="{{ identifier }}"
name="{{ identifier }}"
required
x-moz-errormessage="Județul este obligatoriu"
title="Județul este obligatoriu"
{% if is_disabled %}disabled{% endif %}
>
<option value="" class="select-placeholder">Județul</option>
<optgroup label="București">
{% for number in range(1, 7) %}
<option value="{{ number }}" {{ "selected" if number|string == county }}>Sector {{ number }}</option>
{% endfor %}
</optgroup>
{% for county_name in counties %}
<option value="{{ county_name }}" {{ "selected" if county_name == county }} >{{ county_name }}</option>
{% endfor %}
</select>
Loading

0 comments on commit c882a6d

Please sign in to comment.