@lru_cache(1)
def get_user_flagger():
 user_klass = get_user_model()
 try:
  user = user_klass.objects.get(pk=COMMENT_FLAG_USER_ID)
 except user_klass.DoesNotExist:
  try:
   user = user_klass.objects.get(**{user_klass.USERNAME_FIELD: FLAGGER_USERNAME})
  except user_klass.DoesNotExist:
   user = user_klass.objects.create_user(FLAGGER_USERNAME)
 return user

@ lru_cache ( 1 ) def get_user_flagger ( ) : user_klass = get_user_model ( ) try : user = user_klass . objects . get ( pk = COMMENT_FLAG_USER_ID ) except user_klass . DoesNotExist : try : user = user_klass . objects . get ( ** { user_klass . USERNAME_FIELD : FLAGGER_USERNAME } ) except user_klass . DoesNotExist : user = user_klass . objects . create_user ( FLAGGER_USERNAME ) return user
return an user instance used by the system when flagging a comment as trackback or pingback .