File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ def test_view_brochure_view(client):
3636 brochure = DocumentFactory ()
3737 brochure .tags .add ("sponsorship-brochure" , sponsor_lead .conference .code )
3838
39+ other_brochure = DocumentFactory ()
40+ other_brochure .tags .add ("sponsorship-brochure" , "other-code" )
41+
3942 view_brochure_url_path = reverse ("view-brochure" , args = [sponsor_lead .id ])
4043 signer = Signer ()
4144 signature = signer .sign (view_brochure_url_path ).split (signer .sep )[- 1 ]
Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ def view_brochure(request, sponsor_lead_id):
1212 sponsor_lead .save (update_fields = ["brochure_viewed" ])
1313
1414 Document = get_document_model ()
15- brochure = Document .objects .filter (
16- tags__name__in = ["sponsorship-brochure" , sponsor_lead .conference .code ],
17- ).first ()
15+ brochure = (
16+ Document .objects .filter (tags__name = "sponsorship-brochure" )
17+ .filter (tags__name = sponsor_lead .conference .code )
18+ .first ()
19+ )
1820
1921 return redirect (brochure .url , permanent = False )
You can’t perform that action at this time.
0 commit comments