Projet

Général

Profil

0004-seo-debug-manage-null-variable-32147.patch

Nicolas Roche, 27 juin 2022 10:29

Télécharger (871 octets)

Voir les différences:

Subject: [PATCH 4/4] seo: debug: manage null variable (#32147)

 hobo/seo/views.py | 2 ++
 1 file changed, 2 insertions(+)
hobo/seo/views.py
23 23
from .forms import RobotsTxtForm, SettingsForm
24 24

  
25 25
ALLOW = ""
26 26
DISALLOW = """User-agent: *
27 27
Disallow: /"""
28 28

  
29 29

  
30 30
def get_mode(content):
31
    if content == None:
32
        return 'allow'
31 33
    content = content.strip().replace('\r', '')
32 34
    if content == ALLOW:
33 35
        return 'allow'
34 36
    if content == DISALLOW:
35 37
        return 'disallow'
36 38
    return 'customize'
37 39

  
38 40

  
39
-