#3943 Fix the PYTHONPATH for the dev_worker_1 container
Closed 5 years ago by lenkaseg. Opened 5 years ago by lenkaseg.
Unknown source fix_dev_pythonpath  into  master

file modified
+1 -1
@@ -33,7 +33,7 @@

        - ../lcl/attachments:/attachments:ro

        - ..:/code:z

      environment:

-       - PYTHONPATH=.

+       - PYTHONPATH=/code

        - PAGURE_CONFIG=/code/dev/openshift.cfg

    logcom:

      build:

file modified
+8 -2
@@ -141,7 +141,11 @@

          ],

      )

      avatar_email = wtforms.StringField(

-         "Avatar email", [wtforms.validators.optional()]

+         "Avatar email",

+         [

+             wtforms.validators.Email(message='Hello hello not an email!'),

+             wtforms.validators.optional()

+         ],

      )

      tags = wtforms.StringField(

          "Project tags",
@@ -150,7 +154,9 @@

      private = wtforms.BooleanField(

          "Private", [wtforms.validators.Optional()], false_values=FALSE_VALUES

      )

- 

+   #  def validate_avatar_email(form, avatar_email):

+   #      if not re.match(r"[^@]+@[^@]+\.[^@]+", avatar_email):

+   #          raise ValidationError('Email should look like email')

  

  class ProjectForm(ProjectFormSimplified):

      """ Form to create or edit project. """

When trying to create new project using API, with the create_readme=True
parameter, there was an ImportError: No module named pagure.lib, in
the pre-receive hook of the new project.

In dev_worker_1 container the PYTHONPATH was pointing to ..
The hooks were probably not being run from the workdir set in the
Dockerfile. Now it points to /code and the error is gone.

Pull-Request has been closed by lenkaseg

5 years ago